webdriverjs

Protractor: element.getText() returns an object but not String [duplicate]

断了今生、忘了曾经 提交于 2019-12-25 09:13:52
问题 This question already has answers here : Protractor: element.getText() returns an object and not String (3 answers) Closed 3 years ago . I have also checked link: Protractor: element.getText() returns an object and not String but i found no answer for that on above link and i want string in return?? 回答1: All the protractor's methods return promises, to resolve that promise you need to send something like this: element.getText().then(function(text) { console.log(text); }); or use "expect"--

WebdriverJS : driver.manage().logs().get('browser') returns empty array

你说的曾经没有我的故事 提交于 2019-12-23 15:35:16
问题 I have the following mocha test case, I'm trying to print the webdriver logs in the end, but its returning an empty array. The result is the same even when I pass 'browser' as argument to the logs().get(). Can someone please tell me why the logs are empty? it('should open a url', function(done){ var By = nemo.wd.By; driver.manage().logs(); driver.get("http://www.google.com"); driver.findElement(By.name('q')).sendKeys("webdriver"); driver.findElement(By.name('btnG')).click() driver.manage()

Testing Angularjs Application with Selenium

丶灬走出姿态 提交于 2019-12-22 05:09:30
问题 I am testing an angular js application Link Angular js App when i click on the UI Kit link on the web application i am getting the following error - at demoaj.Ajapp.main(Ajapp.java:16) Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"html/body/div1/div1/aside/div/div/ul/li[2]/a"} Command duration or timeout: 51 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html I am new

Message: function timed out after 5000 milliseconds - Protractor & CucumberJS

假如想象 提交于 2019-12-21 21:03:06
问题 cucumberjs --version 1.2.2 protractor --version 4.0.1 Both installed globally via npm I keep getting this error after upgrading to cucumberJs version above. Failures: 1) Scenario: Get records from DB e2e\features\transac.feature:7 Step: Given I am logged in as "username" with "password"- e2e\features\transac.feature:8 Step Definition: e2e\steps\loginSteps.js:17 Message: function timed out after 5000 milliseconds 1 scenario (1 failed) 1 step (1 failed) 0m06.608s Please note I included my env

Use of Expected Conditions on Non Angular Site with Protractor Leads to “Type Error: Cannot read property 'bind' of undefined”

别来无恙 提交于 2019-12-09 04:03:28
I am seeing following issue when I am using Expected Conditions on webelements returned through element object of Protractor. I tried with $ as well, that resulted in the same thing. I am using Protractor 3.1.1 on Node 4.2.4, Chrome V47.* "Type Error: Cannot read property 'bind' of undefined" Before asking, I searched the forums, and understood there are some known issues with using Expected Conditions with selenium elements using driver.findElement. However, I could not come across a similar issues reported while using element object itself. https://github.com/angular/protractor/issues/1853

Use of Expected Conditions on Non Angular Site with Protractor Leads to “Type Error: Cannot read property 'bind' of undefined”

陌路散爱 提交于 2019-12-08 07:39:33
问题 I am seeing following issue when I am using Expected Conditions on webelements returned through element object of Protractor. I tried with $ as well, that resulted in the same thing. I am using Protractor 3.1.1 on Node 4.2.4, Chrome V47.* "Type Error: Cannot read property 'bind' of undefined" Before asking, I searched the forums, and understood there are some known issues with using Expected Conditions with selenium elements using driver.findElement. However, I could not come across a similar

How to connect and re-use an already opened browser window in Protractor

社会主义新天地 提交于 2019-12-08 05:30:28
问题 In general, the protractor scripts are executed in a new browser instance with the following capabilities capabilities: { 'browserName': 'firefox' } Is there any snippets or ways to tweak this; so that our scripts make use of an already opened browser through protractor. 回答1: What worked for me, for angular2 : Go to WebDriverHub and click on Create Session , copy the generated id (eg: 2919ed90-efac-48ee-83df-46f8e98ebce7 ), you'll need it in step#2. Add/Modify protractor.conf.js to reflect

How to connect and re-use an already opened browser window in Protractor

北城余情 提交于 2019-12-07 16:15:31
In general, the protractor scripts are executed in a new browser instance with the following capabilities capabilities: { 'browserName': 'firefox' } Is there any snippets or ways to tweak this; so that our scripts make use of an already opened browser through protractor. What worked for me, for angular2 : Go to WebDriverHub and click on Create Session , copy the generated id (eg: 2919ed90-efac-48ee-83df-46f8e98ebce7 ), you'll need it in step#2. Add/Modify protractor.conf.js to reflect the following. exports.config.seleniumAddress: ' http://localhost:4444/wd/hub ', exports.config

Message: function timed out after 5000 milliseconds - Protractor & CucumberJS

泪湿孤枕 提交于 2019-12-04 17:54:17
cucumberjs --version 1.2.2 protractor --version 4.0.1 Both installed globally via npm I keep getting this error after upgrading to cucumberJs version above. Failures: 1) Scenario: Get records from DB e2e\features\transac.feature:7 Step: Given I am logged in as "username" with "password"- e2e\features\transac.feature:8 Step Definition: e2e\steps\loginSteps.js:17 Message: function timed out after 5000 milliseconds 1 scenario (1 failed) 1 step (1 failed) 0m06.608s Please note I included my env.js above in the cucumber options block and here's my env.js content: exports.config = { // set to

How do i allow Chrome to use my microphone programatically?

不羁的心 提交于 2019-11-30 02:41:53
I am currently trying to run some tests made with webdriverjs and chromedriver but they need microphone permissions. This is the popup that shows up: I have tried: chromedriver.start(['--disable-popup-blocking']); driver = new Webdriver.Builder() .withCapabilities(Webdriver.Capabilities.chrome()) .build(); but it didn't work. I also tried driver.wait(Until.alertIsPresent(), config.TIMEOUT, 'Alert did not show up'); driver.switchTo().alert().accept(); it did not work either! I guess that this is not an ordinary alert. Useful links: Chrome startup arguments list Chrome options for java and ruby