7

I am trying to execute a basic Selenium Java program:

public static void main(String[] args)
{
    System.setProperty("webdriver.chrome.driver", "C:\\BrowserDrivers\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.quit();
}

With the following configuration:

  • Selenium 4.x
  • Chrome Version 109.0.5414.75 (Official Build) (64-bit) (Win 10)
  • ChromeDriver 109.0.5414.25

ChromeDriver:

ChromeDriver_starting

Chrome and ChromeDriver both being of Version 109.x, though the program executes successfully still I see some WARNING messages on the console as follows:

Starting ChromeDriver 109.0.5414.25 (771113d280dd3dda2fb422a6c805f0eb2b8ee6ed-refs/branch-heads/5414@{#303}) on port 57273
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Jan 14, 2023 3:10:47 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
Jan 14, 2023 3:10:47 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found: a no-op implementation
Jan 14, 2023 3:10:47 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 109.
Jan 14, 2023 3:10:47 AM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.3.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.

Can someone help me to understand the issue behind the warnings:

WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found: a no-op implementation

and

WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.3.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

2 Answers2

5

This is because the compatible version of 'Selenium Dev-Tools' is not yet released. The latest 'Selenium Dev-Tools' version is v108 which is compatible with Chrome version V108.

You can refer the below repository for all the Selenium Dev-Tools versions:

https://repo1.maven.org/maven2/org/seleniumhq/selenium/

I checked with Selenium v4.7.2 with Chrome Version 109.0.5414.75 and with the Chromedriver v109.0.5414.74, got the below same warning:

enter image description here

Then I downgraded Chrome browser to v108.0.5359.126, checked with Selenium v4.7.2 and ChromeDriver v108.0.5359.71, this time didn't get the warning:

enter image description here

The next Selenium Dev-Tools version may be released with the next Selenium upgrade.

You can also install Selenium Dev-Tools separately from Maven respository: https://mvnrepository.com/search?q=Selenium+DevTools+V108

Anyway, this is just a warning.

AbiSaran
  • 2,538
  • 3
  • 9
  • 15
2

CDP

With the availablity of Selenium v4.0.0.0-alpha-1 the basic support for CDP landed via the "DevTools" interface. Moving ahead, from v4.0.0-alpha-4 onwards Chrome Debugging Protocol commands now mirror latest CDP spec.


This usecase

As you were using ChromeDriver/GoogleChrome combo v109.0, support for it was added recently in Selenium v4.8.0:

v4.8.0
======
* Supported CDP versions: 85, 107, 108, 109

So incase someone tries to use ChromeDriver/GoogleChrome combo v109.0 with Selenium v4.7.2 or earlier, Selenium won't be able to find an exact match for CDP version 109 and would return the closest version found i.e. 108

Hence the warning:

WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352