Issue
After updating chrome driver to ChromeDriver 91.0.4472.19
The value
attribute have dissapeared from the input
elements. Protractor cannot access the value attribute.
let x = await xDiv.getEl("#xInput").getAttribute('value');
// x = null
Using the Chrome Dev Tools, I am also not able to see the value
attribute of any input element in the markup.
Using AngularJS 1.5.8 and Protractor/Selenium 3.141.59
Solution
The problem you described is actually a bug in chromedriver https://bugs.chromium.org/p/chromium/issues/detail?id=1205107. It happened because of the change in chrome browser related to W3C compliance
As you can see, the plan is to fix the bug, however it is still in progress.
Meanwhile, I recommend you 2 workarounds:
- you can use chromedriver version 90. The latest version available is here https://chromedriver.storage.googleapis.com/LATEST_RELEASE_90.0.4430
I know that under normal circumstances this would throw incompatibility error, but somehow chromedriver 90 works with chrome 91.
You can downgrade chromedriver by running this command
webdriver-manager update --gecko=false --versions.chrome 90.0.4430.24
Note sometimes you have global, project local and Protractor specific installations of webdriver-manager. The command I gave will install chromedriver globally. In order to install locally you need to find the path to your webdriver-manager and run command like this
node ./node_modules/protractor/node_modules/webdriver-manager update --gecko=false --versions.chrome 90.0.4430.24
And some of you may need to run command in sudo
mode. Keep it in mind
- Instead of
elem.getAttribute('value')
try to go withbrowser.executeScript('return arguments[0].value', elem);
multiple users claimed it works for them
Additionally, read this answer https://stackoverflow.com/a/67888592/9150146 that proposes more hacky solutions
Answered By - Sergey Pleshakov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.