clearValue can't use
[//]: # NOTE: This repository only maintains packages that are listed in the Readme. Please make sure that your issue is directly caused by one of these packages and if not file an issue in the correct 3rd party package repository.
Environment (please complete the following information):
- WebdriverIO version: [7.3.0]
- Mode: []
- If WDIO Testrunner, running sync/async: [e.g. sync/async]
- Node.js version: [v14.16.0]
- NPM version: [e.g. 5.8.0]
- Browser name and version: [e.g. Chrome 68]
- Platform name and version: [e.g. Mac OS]
- Additional wdio packages used (if applicable): [e.g. @wdio/cli]
Config of WebdriverIO default WebdriverIO config
Describe the bug clearValue Can't use
To Reproduce
this.inputUsername.setValue(username);
browser.pause(2000);
this.inputUsername.clearValue(username);
browser.pause(2000);
https://github.com/Tzng/webdriver-test
Expected behavior clear input value
Hey @Tzng ,
thanks for filing the issue. This seems to be related to Chromedriver, so I filled a bug in that project. There is nothing we can do to fix it. As a workaround I recommend doing this:
browser.overwriteCommand('clearValue', function () {
browser.execute((elem) => (elem.value = ''), this)
}, true)
This would overwrite the clearValue command and would clear it through JS. I tested it and it works well. You can have this statement in your before hook in your wdio.conf.js.
Hey @Tzng ,
thanks for filing the issue. This seems to be related to Chromedriver, so I filled a bug in that project. There is nothing we can do to fix it. As a workaround I recommend doing this:
browser.overwriteCommand('clearValue', function () { browser.execute((elem) => (elem.value = ''), this) }, true)This would overwrite the
clearValuecommand and would clear it through JS. I tested it and it works well. You can have this statement in yourbeforehook in yourwdio.conf.js.
Hey @Tzng ,
thanks for filing the issue. This seems to be related to Chromedriver, so I filled a bug in that project. There is nothing we can do to fix it. As a workaround I recommend doing this:
browser.overwriteCommand('clearValue', function () { browser.execute((elem) => (elem.value = ''), this) }, true)This would overwrite the
clearValuecommand and would clear it through JS. I tested it and it works well. You can have this statement in yourbeforehook in yourwdio.conf.js.
Okay, this is really great