-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Chrome 91 will break more Protractor tests #5519
Comments
Node Version: 14.17.0 DevTools listening on ws://127.0.0.1:50372/devtools/browser/f2d2213a-b6e6-4f59-8534-d7c75a6d99d9 Getting this error when updating the chrome to 91 version else this issue is working fine on 90 version of chrome. |
I confirm that Perhaps, It's possible to use this hack to get the value of the
|
I can also confirm. I know this is just saying +1, but if we could get the attention of some of the Angular team, it'd be great. |
The last chromedriver that worked with Until chromedriver gets patched (which seems like it will be according to this thread posted by @StanislavKharchenko) we use this fix in our ci pipeline to use that version run our angular protractor tests. This is what out pipline looked like before: Setup:
npm install
node ./node_modules/.bin/webdriver-manager update
Script:
ng e2e --protractorConfig=./path/to/protractor/config.js This is what it looks like after: Setup:
npm install
node ./node_modules/.bin/webdriver-manager update --versions.chrome=90.0.4430.24
Script:
ng e2e --protractorConfig=./path/to/protractor/config.js --webdriver-update false Good luck! |
Using class but still unable to get the value. Tried with id also but not working. |
The matjoh's temporary workaround is working for me. Thanks |
ChromeDriver 91 introduced a breaking change that makes GetElementAttribute command return `null` instead of the actual attribute value. This change works around this issue by making Serenity/JS automatically fall back to retrieving the attribute value using injected JavaScript should WebElement.getAttribute(name) return `null`. References: - https://bugs.chromium.org/p/chromium/issues/detail?id=1205107&start=300 - angular/protractor#5519
I also confirm that element.getAttribute('value') where element is input or textarea always returns null when used with chromedriver=91.0.4472.19 (chrome=91.0.4472.77). Workarounds: // getAttribute('value')
async getValue(elem: ElementFinder): Promise<string> {
return browser.executeScript(
'return arguments[0].value',
await elem.getWebElement()
);
}
// clear();
async clearInput(elem: ElementFinder): Promise<string> {
return elem.sendKeys(
protractor.Key.chord(protractor.Key.CONTROL, 'A'), // Linux, Windows
protractor.Key.chord(protractor.Key.COMMAND, 'A'), // macOS
protractor.Key.BACK_SPACE
);
} |
I've described the problem and possible solutions in this article. Also, for Serenity/JS developers reading this thread - Learn more: Serenity/JS website and API docs, template projects for Protractor, community chat. |
This seems to be related to #5522 I was actually verifying the error with getAttribute('value') on firefox but from this ticket i understand the error is more broad. what do you think? |
@evilaliv3 Thanks for posting that! @angular team, @kyliau, @Splaktar Could you please give to community some info about upgrades to selenium 4.0? I've added a PR, but any activities are stalled again :( |
If you have no ability to fix the environment, you can take
|
@navix This is a bad practice to execute js code directly to invoke value from. @kyliau @IgorMinar @Splaktar ping! Please say smth. |
That. I do not have any joy of using it, but at this stage it can be useful. |
@navix There was a decision to continue Protractor as v6 without control flow. |
FYI: Chromium fixed the compatibility issue for the JWP legacy mode. See: https://chromium-review.googlesource.com/c/chromium/src/+/2931437. The fix is available in the latest Chromium development version, and has also been cherry-picked back into M91 and M92. Given that this was a bug within Chromium, I don't think there is any action for Protractor here. It's reasonable to say that Protractor, if it would be W3C compliant, wouldn't have hit this bug. Though, making Protractor W3C compliant seems like a different issue? |
@devversion Given that this issue tracked by chromium so much time we can’t allow such risks and switched to Protractor v6. We’re also not sure about next surprises with the legacy jwp. Also we don’t know how long browsers will support this protocol. |
Closing this due to lack of activities from maintainers. |
Bug report
14.17.0
7.0.0
Chrome v91
Windows 10
The issue started to reproduce with the release of chromedriver v91.
https://bugs.chromium.org/p/chromium/issues/detail?id=1205107&start=300
Method getAttribute will always return null within usage of older JWP (w3c: false).
From another side, with the w3c: true on legacy Selenium 3 - browser actions are not working due to incompatibility.
So the recommendation is to upgrade with selenium-webdriver 4.0 where full support of w3c implemented.
I have added a PR where made upgrades with the latest selenium 4.0
The text was updated successfully, but these errors were encountered: