The short answer is NO . Currently, you cannot hook key commands with any driver configuration. .keys() actually still works with chromedriver (only sending text, no chaining), but it has been flagged for obsolescence. See below 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?
- This is a known issue in the entire Selenium community and will not be fixed / resolved in WebdriverIO until the drivers (
chromedriver , geckodriver , etc.) implement the new W3C Webdriver standard for user input, API Actions ; - there is no other way to do this (believe me, I tried!) if you cannot actually replace the functionality of your
CTRL + M action with code; - here is a BUG that documents this issue for GeckoDriver (Firefox);
- even if the
.keys() method works with your current version, Christian-Bromann has confirmed that it will be deprecated in the next version (it is also marked for deprecation in the /lib/protocol/keys.js definition /lib/protocol/keys.js ).
Note. For those who have similar problems with various WDIO commands, the deprecated .keys() (WDIO), .sendKeys() (WebdriverJS) also apply to other broken WebdriverIO methods like .moveTo() . Read more about it here .
source share