webdriver-io

How to click on CTRL+M (Control + M) in WebdriverIO

杀马特。学长 韩版系。学妹 提交于 2019-12-11 01:23:13
问题 I have to issue a CTRL+M action in WebdriverIO, but it is not working. I have tried using different ways such as: browser.keys('Control').keys('m'); browser.keys(['Control','KeyM', 'NULL']); browser.keys(['Control', 'm', 'NULL']); browser.keys('Control').keys('KeyM'); browser.deviceKeyEvent(82); browser.pressKeycode(82); browser.keys('MENU'); None of the above are working. Can anyone help me? 回答1: Short answer, NO . You currently cannot chain key commands with any driver configuration. .keys(

How to debug webdriverio in standalone mode?

寵の児 提交于 2019-12-10 17:05:35
问题 http://webdriver.io/guide/getstarted/modes.html I'm going absolutely nuts trying to debug a webdriverio test using Chromedriver. You simply cannot step through the code because webdriverio commands are asynchronous and the browser session is out of sync with the test. This is frustrating because reading the docs, it seems you need a testing framework like Chai or wdio to generate tests, but this seems like a lot of work just to have procedural synchronous commands. I just need to crawl some

WebdriverIO - Take full-page screenshot

对着背影说爱祢 提交于 2019-12-09 13:31:09
问题 I'm trying to take a screenshot of the full page using WebdriverIO. I've read that the best method is to use WebdriverCSS to enhance my WebdriverIO flows. WebdriverCSS automatically screenshots the entire page?? The problem is that WebdriverCSS is not working for me. I think it's because it is not yet compatible with webdriverio@3.0.x . Is there any way to make it work or another solution that I could use? My code: ( which is producing nothing but undefined values in the callback ) //

wdio-cucumber-framework - Keep same webdriver session during single test execution

烈酒焚心 提交于 2019-12-08 06:29:54
问题 I am using wdio-cucumber-framework for my test automation. I have test cases in multiple .feature files. When I execute test cases a new webdriver browser instance is generated for each feature file. settings in wdio.config.js capabilities: [{ maxInstances: 1, browserName: 'chrome' }], services: ['selenium-standalone'], framework: 'cucumber', reporters: ['spec'], Feature File 1 ---> 5 test cases Feature File 2 ---> 2 test cases When I execute all the test cases in both feature files, a

How to set preference for downloading .dmg file using WebdriverIO?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 05:10:01
问题 I want to download a .dmg file using webdriverIO and when the link has been clicked the file download popup pops out which is a .dmg file. How can I handle the popup which asks "save" or "cancel"? 回答1: If the problem is save popup then you can avoid the popup by setting the default download location for the browser. For CHROME: In the wdio.conf.js file, in the capabilities add the below: Before adding make sure you have defined downloadDir with the default path where the file needs to be

Webdriver.io elements usage

谁说胖子不能爱 提交于 2019-12-08 01:04:32
问题 I want to iterate over element and do some thing on all of them, e.g. set values etc. For now i have following code, but i cant even get attribute from selected elements. client.elements("freeforms-widget").then(function (elems) { for (let elem of elems.value) { let k = client.elementIdAttribute(elem.ELEMENT,'name'); console.log(k); } }) And all i see is following : { state: 'pending' } { state: 'pending' } { state: 'pending' } { state: 'pending' } { state: 'pending' } { state: 'pending' }

Avoid re-entering user/email and password with WebDriverIO in login form

大兔子大兔子 提交于 2019-12-07 23:05:19
问题 I'm looking for someone to tell me how can I avoid to re-enter everytime the username and password when I run a Testdrive with webdriverIO using the chromedriver and selenium. What I want is to optimize my testdrive. Some clue??? this two file are parts of one module and there is 4 modules in the system first file: var name = 'Andrea' + Math.floor((Math.random() * 1000000) + 1); var ssn = 'V-' + Math.floor((Math.random() * 1000000) + 1); var url = 'http://someurl.com'; var new_contact =

How to simulate ctrl-click or shift-click with webdriver.io?

ぐ巨炮叔叔 提交于 2019-12-07 06:45:25
问题 With webdriver.io I would like to simulate clicks with a modifier like shift or ctrl . The keys() method seems to do something like that but it's not clear to me how to release a modifier key again and it throws an error when I use 16 (key code for shift ) as a parameter for the method - link. Background: In my webpage that I test I have a list of elements that are comparable to files and folders in a file browser and it is possible to select multiple of those with shift and ctrl . This works

wdio-cucumber-framework - Keep same webdriver session during single test execution

依然范特西╮ 提交于 2019-12-07 03:15:28
I am using wdio-cucumber-framework for my test automation. I have test cases in multiple .feature files. When I execute test cases a new webdriver browser instance is generated for each feature file. settings in wdio.config.js capabilities: [{ maxInstances: 1, browserName: 'chrome' }], services: ['selenium-standalone'], framework: 'cucumber', reporters: ['spec'], Feature File 1 ---> 5 test cases Feature File 2 ---> 2 test cases When I execute all the test cases in both feature files, a browser instance is launched for feature file 1. Once all the 5 test cases in feature file 1 are executed,

Avoid re-entering user/email and password with WebDriverIO in login form

岁酱吖の 提交于 2019-12-06 09:22:45
I'm looking for someone to tell me how can I avoid to re-enter everytime the username and password when I run a Testdrive with webdriverIO using the chromedriver and selenium. What I want is to optimize my testdrive. Some clue??? this two file are parts of one module and there is 4 modules in the system first file: var name = 'Andrea' + Math.floor((Math.random() * 1000000) + 1); var ssn = 'V-' + Math.floor((Math.random() * 1000000) + 1); var url = 'http://someurl.com'; var new_contact = 'https://someurl.com/client/add'; describe('Some contact is create', function(){ it('Should login to the