My code is not performing any action on browser even though the method is getting executedNot able to navigate from Non-angular page to angular page in iframeSetting up Protractor with cucumberjs (protractor-cucumber-framework)Best way to exeute various tests in protractor for various login id'sHow can i execute external script or function which generate random mail in mail field in the protractor scriptSelenium example using Node.js from MDN not working?how to get browser and server details while execution of protractor testingFeature files are not running in defined order on Selenium junit?Cucumber, repeating login steps in all scenarioscucumber and protractor html and json
Realistic melange - Part 1: Formation
How can I deal with a player trying to insert real-world mythology into my homebrew setting?
Referring to different instances of the same character in time travel
As a DM, how to avoid unconscious metagaming when dealing with a high AC character?
How do I get count of number of items in selection?
Why isn't there research to build a standard lunar, or Martian mobility platform?
Optimising Table wrapping over a Select
Why would guns not work in the dungeon?
Why did my rum cake turn black?
Robbers: The Hidden OEIS Substring
Cubic programming and beyond?
Correct use of ergeben?
Redirect https to fqdn
Are there any intersection of Theory A and Theory B?
Why is dry soil hydrophobic? Bad gardener paradox
Machine learning and operations research projects
Stuck Apple Mail - how to reset?
Was adding milk to tea started to reduce employee tea break time?
<schwitz>, <zwinker> etc. Does German always use 2nd Person Singular Imperative verbs for emoticons? If so, why?
Is a Lisp program in both prog-mode and lisp-mode?
I quit, and boss offered me 3 month "grace period" where I could still come back
diff shows a file that does not exist
When did the Roman Empire fall according to contemporaries?
Bronze Age Underwater Civilization
My code is not performing any action on browser even though the method is getting executed
Not able to navigate from Non-angular page to angular page in iframeSetting up Protractor with cucumberjs (protractor-cucumber-framework)Best way to exeute various tests in protractor for various login id'sHow can i execute external script or function which generate random mail in mail field in the protractor scriptSelenium example using Node.js from MDN not working?how to get browser and server details while execution of protractor testingFeature files are not running in defined order on Selenium junit?Cucumber, repeating login steps in all scenarioscucumber and protractor html and json
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to implement the Protractor-Cucumber-framework in my project. When I execute the code, methods are getting executed but the code inside the method is not getting executed. I mean when I tried to click or enter the data in field or pause the browser execution through browser.sleep these actions are getting performed and also my script is not failing.
My stepDef file
var login=require("../src/main/java/Utilities/LoginPage.js");
var test1=function()
var local=this;
Given('Open the Browser', function ()
console.log("first executed")
browser.ignoreSynchronization=true;
login.get("https://abhibus.com");
);
Given('Load the URL', function ()
// Write code here that turns the phrase above into concrete actions
console.log("second executed");
browser.getTitle().then(function(title)
console.log(title+" title of the webpage");
);
browser.sleep(5000);
);
Then('Get the Title of the webpage', function ()
// Write code here that turns the phrase above into concrete actions
console.log("third executed");
browser.driver.findElement(By.id("LoginForm_username")).sendKeys("admin@admin@bkcms.com");
browser.driver.findElement(By.id("Loginform_password")).sendKeys("test");
// login.loginpage("admin@admin@bkcms.com","test");
browser.sleep(3000);
);
module.exports=new test1();
My Feature File
Feature: this to test new Application
Scenario: This a new Scenario
Given This is to load URL
And do some action on webpage
Then Print the title of the webpage
My Config File
exports.config =
seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 60000,
allScriptsTimeout: 500000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities:
'browserName': 'chrome'
,
// Spec patterns are relative to this directory.
specs: [
'../Protractor.Cucumber.Test/src/main/java/featureFiles/Test.feature'
],
cucumberOpts:
require: '../Protractor.Cucumber.Test/src/test/java/StepDefinitions/test1.js',
tags: false,
profile: false,
'no-source': true
,
onPrepare: function ()
const Given, Then, When, Before = require('cucumber');
global.Given = Given;
global.When = When;
global.Then = Then;
global.Before = Before;
;
Result of the code
I/launcher - Running 1 instances of WebDriver
[09:56:12] I/hosted - Using the selenium server at
http://localhost:4444/wd/hub
first executed
.second executed
.third executed
..
1 scenario (1 passed)
3 steps (3 passed)
0m00.008s
Login Page Code
var properties=PropertiesReader("../Protractor.Cucumber.Test/src/main/java/Utilities/Object.properties");
var login=function()
var user=by.xpath("//input[@id='LoginForm_username']");
var pass=by.id("LoginForm_password");
var submit=by.id("login_submit");
var local=this;
this.Init=function()
local.username();
local.password();
local.Submit();
this.get=function()
browser.get(properties.get("url"));
browser.manage().window().maximize();
browser.driver.sleep(5000);
this.username=function()
return element(user);
this.password=function()
return element(pass);
this.Submit=function()
return element(submit);
this.loginpage=function(Username,Password)
console.log("entred in to login method")
var userfield=local.username();
userfield.sendKeys(Username);
var passfield=local.password();
passfield.sendKeys(Password);
var button=local.Submit();
button.click();
browser.driver.sleep(5000);
module.exports=new login();
node.js selenium-webdriver protractor cucumber cucumberjs
add a comment |
I'm trying to implement the Protractor-Cucumber-framework in my project. When I execute the code, methods are getting executed but the code inside the method is not getting executed. I mean when I tried to click or enter the data in field or pause the browser execution through browser.sleep these actions are getting performed and also my script is not failing.
My stepDef file
var login=require("../src/main/java/Utilities/LoginPage.js");
var test1=function()
var local=this;
Given('Open the Browser', function ()
console.log("first executed")
browser.ignoreSynchronization=true;
login.get("https://abhibus.com");
);
Given('Load the URL', function ()
// Write code here that turns the phrase above into concrete actions
console.log("second executed");
browser.getTitle().then(function(title)
console.log(title+" title of the webpage");
);
browser.sleep(5000);
);
Then('Get the Title of the webpage', function ()
// Write code here that turns the phrase above into concrete actions
console.log("third executed");
browser.driver.findElement(By.id("LoginForm_username")).sendKeys("admin@admin@bkcms.com");
browser.driver.findElement(By.id("Loginform_password")).sendKeys("test");
// login.loginpage("admin@admin@bkcms.com","test");
browser.sleep(3000);
);
module.exports=new test1();
My Feature File
Feature: this to test new Application
Scenario: This a new Scenario
Given This is to load URL
And do some action on webpage
Then Print the title of the webpage
My Config File
exports.config =
seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 60000,
allScriptsTimeout: 500000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities:
'browserName': 'chrome'
,
// Spec patterns are relative to this directory.
specs: [
'../Protractor.Cucumber.Test/src/main/java/featureFiles/Test.feature'
],
cucumberOpts:
require: '../Protractor.Cucumber.Test/src/test/java/StepDefinitions/test1.js',
tags: false,
profile: false,
'no-source': true
,
onPrepare: function ()
const Given, Then, When, Before = require('cucumber');
global.Given = Given;
global.When = When;
global.Then = Then;
global.Before = Before;
;
Result of the code
I/launcher - Running 1 instances of WebDriver
[09:56:12] I/hosted - Using the selenium server at
http://localhost:4444/wd/hub
first executed
.second executed
.third executed
..
1 scenario (1 passed)
3 steps (3 passed)
0m00.008s
Login Page Code
var properties=PropertiesReader("../Protractor.Cucumber.Test/src/main/java/Utilities/Object.properties");
var login=function()
var user=by.xpath("//input[@id='LoginForm_username']");
var pass=by.id("LoginForm_password");
var submit=by.id("login_submit");
var local=this;
this.Init=function()
local.username();
local.password();
local.Submit();
this.get=function()
browser.get(properties.get("url"));
browser.manage().window().maximize();
browser.driver.sleep(5000);
this.username=function()
return element(user);
this.password=function()
return element(pass);
this.Submit=function()
return element(submit);
this.loginpage=function(Username,Password)
console.log("entred in to login method")
var userfield=local.username();
userfield.sendKeys(Username);
var passfield=local.password();
passfield.sendKeys(Password);
var button=local.Submit();
button.click();
browser.driver.sleep(5000);
module.exports=new login();
node.js selenium-webdriver protractor cucumber cucumberjs
What version of protractor are you using?
– DublinDev
Mar 26 at 6:58
Can you please share your login page codes.
– Selçuk Ayhan
Mar 26 at 7:08
Okk Updating the Loging Page Code
– Satish Rongala
Mar 26 at 8:25
DublinDev, My Protractor Version 5.4.0
– Satish Rongala
Mar 26 at 8:29
add a comment |
I'm trying to implement the Protractor-Cucumber-framework in my project. When I execute the code, methods are getting executed but the code inside the method is not getting executed. I mean when I tried to click or enter the data in field or pause the browser execution through browser.sleep these actions are getting performed and also my script is not failing.
My stepDef file
var login=require("../src/main/java/Utilities/LoginPage.js");
var test1=function()
var local=this;
Given('Open the Browser', function ()
console.log("first executed")
browser.ignoreSynchronization=true;
login.get("https://abhibus.com");
);
Given('Load the URL', function ()
// Write code here that turns the phrase above into concrete actions
console.log("second executed");
browser.getTitle().then(function(title)
console.log(title+" title of the webpage");
);
browser.sleep(5000);
);
Then('Get the Title of the webpage', function ()
// Write code here that turns the phrase above into concrete actions
console.log("third executed");
browser.driver.findElement(By.id("LoginForm_username")).sendKeys("admin@admin@bkcms.com");
browser.driver.findElement(By.id("Loginform_password")).sendKeys("test");
// login.loginpage("admin@admin@bkcms.com","test");
browser.sleep(3000);
);
module.exports=new test1();
My Feature File
Feature: this to test new Application
Scenario: This a new Scenario
Given This is to load URL
And do some action on webpage
Then Print the title of the webpage
My Config File
exports.config =
seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 60000,
allScriptsTimeout: 500000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities:
'browserName': 'chrome'
,
// Spec patterns are relative to this directory.
specs: [
'../Protractor.Cucumber.Test/src/main/java/featureFiles/Test.feature'
],
cucumberOpts:
require: '../Protractor.Cucumber.Test/src/test/java/StepDefinitions/test1.js',
tags: false,
profile: false,
'no-source': true
,
onPrepare: function ()
const Given, Then, When, Before = require('cucumber');
global.Given = Given;
global.When = When;
global.Then = Then;
global.Before = Before;
;
Result of the code
I/launcher - Running 1 instances of WebDriver
[09:56:12] I/hosted - Using the selenium server at
http://localhost:4444/wd/hub
first executed
.second executed
.third executed
..
1 scenario (1 passed)
3 steps (3 passed)
0m00.008s
Login Page Code
var properties=PropertiesReader("../Protractor.Cucumber.Test/src/main/java/Utilities/Object.properties");
var login=function()
var user=by.xpath("//input[@id='LoginForm_username']");
var pass=by.id("LoginForm_password");
var submit=by.id("login_submit");
var local=this;
this.Init=function()
local.username();
local.password();
local.Submit();
this.get=function()
browser.get(properties.get("url"));
browser.manage().window().maximize();
browser.driver.sleep(5000);
this.username=function()
return element(user);
this.password=function()
return element(pass);
this.Submit=function()
return element(submit);
this.loginpage=function(Username,Password)
console.log("entred in to login method")
var userfield=local.username();
userfield.sendKeys(Username);
var passfield=local.password();
passfield.sendKeys(Password);
var button=local.Submit();
button.click();
browser.driver.sleep(5000);
module.exports=new login();
node.js selenium-webdriver protractor cucumber cucumberjs
I'm trying to implement the Protractor-Cucumber-framework in my project. When I execute the code, methods are getting executed but the code inside the method is not getting executed. I mean when I tried to click or enter the data in field or pause the browser execution through browser.sleep these actions are getting performed and also my script is not failing.
My stepDef file
var login=require("../src/main/java/Utilities/LoginPage.js");
var test1=function()
var local=this;
Given('Open the Browser', function ()
console.log("first executed")
browser.ignoreSynchronization=true;
login.get("https://abhibus.com");
);
Given('Load the URL', function ()
// Write code here that turns the phrase above into concrete actions
console.log("second executed");
browser.getTitle().then(function(title)
console.log(title+" title of the webpage");
);
browser.sleep(5000);
);
Then('Get the Title of the webpage', function ()
// Write code here that turns the phrase above into concrete actions
console.log("third executed");
browser.driver.findElement(By.id("LoginForm_username")).sendKeys("admin@admin@bkcms.com");
browser.driver.findElement(By.id("Loginform_password")).sendKeys("test");
// login.loginpage("admin@admin@bkcms.com","test");
browser.sleep(3000);
);
module.exports=new test1();
My Feature File
Feature: this to test new Application
Scenario: This a new Scenario
Given This is to load URL
And do some action on webpage
Then Print the title of the webpage
My Config File
exports.config =
seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 60000,
allScriptsTimeout: 500000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities:
'browserName': 'chrome'
,
// Spec patterns are relative to this directory.
specs: [
'../Protractor.Cucumber.Test/src/main/java/featureFiles/Test.feature'
],
cucumberOpts:
require: '../Protractor.Cucumber.Test/src/test/java/StepDefinitions/test1.js',
tags: false,
profile: false,
'no-source': true
,
onPrepare: function ()
const Given, Then, When, Before = require('cucumber');
global.Given = Given;
global.When = When;
global.Then = Then;
global.Before = Before;
;
Result of the code
I/launcher - Running 1 instances of WebDriver
[09:56:12] I/hosted - Using the selenium server at
http://localhost:4444/wd/hub
first executed
.second executed
.third executed
..
1 scenario (1 passed)
3 steps (3 passed)
0m00.008s
Login Page Code
var properties=PropertiesReader("../Protractor.Cucumber.Test/src/main/java/Utilities/Object.properties");
var login=function()
var user=by.xpath("//input[@id='LoginForm_username']");
var pass=by.id("LoginForm_password");
var submit=by.id("login_submit");
var local=this;
this.Init=function()
local.username();
local.password();
local.Submit();
this.get=function()
browser.get(properties.get("url"));
browser.manage().window().maximize();
browser.driver.sleep(5000);
this.username=function()
return element(user);
this.password=function()
return element(pass);
this.Submit=function()
return element(submit);
this.loginpage=function(Username,Password)
console.log("entred in to login method")
var userfield=local.username();
userfield.sendKeys(Username);
var passfield=local.password();
passfield.sendKeys(Password);
var button=local.Submit();
button.click();
browser.driver.sleep(5000);
module.exports=new login();
node.js selenium-webdriver protractor cucumber cucumberjs
node.js selenium-webdriver protractor cucumber cucumberjs
edited Mar 26 at 8:28
Satish Rongala
asked Mar 26 at 4:44
Satish RongalaSatish Rongala
12 bronze badges
12 bronze badges
What version of protractor are you using?
– DublinDev
Mar 26 at 6:58
Can you please share your login page codes.
– Selçuk Ayhan
Mar 26 at 7:08
Okk Updating the Loging Page Code
– Satish Rongala
Mar 26 at 8:25
DublinDev, My Protractor Version 5.4.0
– Satish Rongala
Mar 26 at 8:29
add a comment |
What version of protractor are you using?
– DublinDev
Mar 26 at 6:58
Can you please share your login page codes.
– Selçuk Ayhan
Mar 26 at 7:08
Okk Updating the Loging Page Code
– Satish Rongala
Mar 26 at 8:25
DublinDev, My Protractor Version 5.4.0
– Satish Rongala
Mar 26 at 8:29
What version of protractor are you using?
– DublinDev
Mar 26 at 6:58
What version of protractor are you using?
– DublinDev
Mar 26 at 6:58
Can you please share your login page codes.
– Selçuk Ayhan
Mar 26 at 7:08
Can you please share your login page codes.
– Selçuk Ayhan
Mar 26 at 7:08
Okk Updating the Loging Page Code
– Satish Rongala
Mar 26 at 8:25
Okk Updating the Loging Page Code
– Satish Rongala
Mar 26 at 8:25
DublinDev, My Protractor Version 5.4.0
– Satish Rongala
Mar 26 at 8:29
DublinDev, My Protractor Version 5.4.0
– Satish Rongala
Mar 26 at 8:29
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350008%2fmy-code-is-not-performing-any-action-on-browser-even-though-the-method-is-gettin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350008%2fmy-code-is-not-performing-any-action-on-browser-even-though-the-method-is-gettin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What version of protractor are you using?
– DublinDev
Mar 26 at 6:58
Can you please share your login page codes.
– Selçuk Ayhan
Mar 26 at 7:08
Okk Updating the Loging Page Code
– Satish Rongala
Mar 26 at 8:25
DublinDev, My Protractor Version 5.4.0
– Satish Rongala
Mar 26 at 8:29