selenium: Unable to find an exact match for CDP version 123, returning the closest version; found: 121; Please update to a Selenium version that supports CDP version 123[🐛 Bug]:
What happened?
This warning keeps appearing even though it is already on the latest version, but everything works normally, as you can see in the log I have selenium 4.19.1, chrome 123, chromedriver 123 too, everything is newer and it still keeps giving me this warning,in termux android it is also like this.
How can we reproduce the issue?
just do a simple initialization
Relevant log output
abr. 09, 2024 11:58:09 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 123, returning the closest version; found: 121; Please update to a Selenium version that supports CDP version 123
Exception in thread "main" org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=123.0.6312.105)
Build info: version: '4.19.1', revision: 'abe0ee07dc'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.19-1-MANJARO', java.version: '17.0.10'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [af1ba61b77ba5e871e6ff0dbffde014d, getCurrentWindowHandle {}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 123.0.6312.105, chrome: {chromedriverVersion: 123.0.6312.105 (399174dbe6e..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:35165}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://localhost:35165/devtoo..., se:cdpVersion: 123.0.6312.105, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Operating System
BigLinux
Selenium version
Java 17.0.10
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
Are you using Selenium Grid?
no
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 35 (14 by maintainers)
i was getting the same warning, then i upgraded my pom.xml with the latest selenium-java version 4.20.0 and after that the warning went away.
Oh yes, I forgot to close this. Thank you for the reminder.
Ah, was looking for another issue but saw this, this is an issue for me as well and has been ongoing since at least December:
Seems to be the case when packaging it as a fat jar indeed as that is the commonality I can see.
@theAnand17 this warning is created via logger here: https://github.com/SeleniumHQ/selenium/blob/aa62f106c736172ff4ccea9399ca005b43140250/java/src/org/openqa/selenium/devtools/CdpVersionFinder.java#L146-L151
@BowlinAndBoatin I am asking because this issue only happens when you repackage the Selenium jar. If you are not doing that, then you are not having this same issue. You should create a new one sharing a way to reproduce it.
Okay, i think building a jar with all dependencies in it does break the ServiceLoader. I currently have no access to a development environment, so i can not verify this. All dev-tools jar have the same descriptor file in META-INF/services with different content, merging them to one jar will overwrite them and only one version will pass this process. This could be the reason why only one can be found.
I just wanted to let you know that you did not mention those details.
@pujagani @joerg1985 do you know why the wrong CDP class is selected in the packaged jar?
Can you share the complete pom please?