1

Get Attribute Value returning null after updating to latest chrome version 91.0.4472.77. Before update it was working fine

   selector.getAttribute('value')  => returning null

Is there any alternative or solution for this ?

mahip_j
  • 368
  • 2
  • 11

2 Answers2

0

Below solution worked for me. We have written a function for return attributes. Inside that we kept return browser.executeScript('return arguments[0].value', elem);

getAttribute will continue to work if attribute is part of DOM.

0

I found a temp workaround that just worked with chrome 91.0.4472.114 on mac

The problem described here is actually a bug in chromedriver https://bugs.chromium.org/p/chromium/issues/detail?id=1205107 so it is not Protractor problem only

While it's being worked on, you can use chromedriver version 90. Works like a charm. The latest version available is here https://chromedriver.storage.googleapis.com/LATEST_RELEASE_90.0.4430

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

Sergey Pleshakov
  • 7,964
  • 2
  • 17
  • 40