[🐛 Bug]: chrome 123: JavascriptException instead of InvalidSelectorException raised when using invalid selector
After upgrading to chrome/chromedriver 123, invalid selectors are raised as JavascriptException instead of InvalidSelectorException. This worked as expected with chrome 122.
JavascriptException: Message: javascript error: {"status":32,"value":"An invalid or illegal selector was specified"}
Expected is to raise InvalidSelectorException
### Relevant log output
```shell
JavascriptException: Message: javascript error: {"status":32,"value":"An invalid or illegal selector was specified"}
Operating System
Ubuntu
Selenium version
What are the browser(s) and version(s) where you see this issue?
chrome 123
What are the browser driver(s) and version(s) where you see this issue?
chromedriver 123.0.6262.0
Are you using Selenium Grid?
No response
@webtoman, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
changed the title
[🐛 Bug]: JavascriptException instead of InvalidSelectorException raised when using invalid selector
[🐛 Bug]: chrome 123: JavascriptException instead of InvalidSelectorException raised when using invalid selector
Mar 20, 2024
FYI, I am dead in the water with this issue as well. For me all sorts of selectors are failing but not always, I have a huge test suite. The failures are consistent but only within a given test/ area of the application. In other areas of the application/ other tests, the same selectors work. The failing selectors include by.id, by.linktext, select.getFirstSelectedOption(), etc... Any way to downgrade chrome? I found the v121 exe, but I can not remove the upgrade-demmand (no longer uses google windows update services)
I am using latest Selenium/Java 4.18.1, Windows, Chrome 123:
Hmm... just saw this in the stdout of selenium running under junit:
java] Session ID: 68cba6d9e2527bddcef83b0147703e44
[java] RUNNING TEST: com.xxxxxxxxxxx.xxxx.systemtest.reporting.DecorationSummaryScheduleReportTest
[java] Mar 21, 2024 3:14:59 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
[java] WARNING: Unable to find an exact match for CDP version 123, returning the closest version; found: 122; Please update to a Selenium version that supports CDP version 123
[java] Mar 21, 2024 3:15:49 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
[java] WARNING: Unable to find an exact match for CDP version 123, returning the closest version; found: 122; Please update to a Selenium version that supports CDP version 123
Thank you for reporting this. It is indeed an issue in ChromeDriver 123. I just reported it, and we need to wait for the Chrome folks to land a fix for it.
For reference, here is the bug report: https://bugs.chromium.org/p/chromedriver/issues/detail?id=4743