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?
Short answer, NO. You currently cannot chain key commands with any driver configuration. .keys()
does in fact still work with chromedriver
(only sending text, no chaining), yet it has been marked for deprecation. See list bellow for more details.
Dependencies:
"selenium-standalone": "^5.11.2",
"wdio-selenium-standalone-service": "0.0.8",
"webdriverio": "4.8.0"
Driver versions affected:
ChromeDriver: 2.29-x64-chromedriver
GeckoDriver: 0.16.0-x64-geckodriverIEDriver:
3.4.0-x64-IEDriverServer
What is wrong with the .keys()
command?
chromedriver
, geckodriver
, etc.) implement Webdriver's new W3C standard for user input, Actions API;CTRL + M
action via code;.keys()
method is working with your current version, Christian-Bromann confirmed it will be deprecated in the next release (it is also marked for deprecation in the /lib/protocol/keys.js
definition file).Note: For anyone having similar issues with different WDIO commands, the deprecation of .keys()
(WDIO), .sendKeys()
(WebdriverJS) also applies to other broken WebdriverIO methods like .moveTo()
. Read more about it here.