We have below webdrivermanager version in our pom. But is there anyway you can see/find the version of chromedriver used by it?:-
<webdrivermanager.version>3.8.0</webdrivermanager.version>
Ok, I have found it from trace while running the tests:-
Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987#{#882}) on port 36187
Only local connections are allowed.
Related
I am sure that my tests are working correctly. When I run the code I got the error in terminal like,
Scenario: User adds new quick work order to employee from website # src/test/java/Features/5NewQuickJobOrder.feature:12
Starting ChromeDriver 111.0.5563.19 (378a38865270d286695aeb86f190564911ef7bc2-refs/branch-heads/5563#{#251}) on port 4290
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 111
Current browser version is 110.0.5481.97 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-CONJ3EC', ip: '192.168.1.27', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '19.0.2'
Driver info: driver.version: ChromeDriver
Recently Chrome updates itself and my version is now 110.0.5481.97. But somehow it tries the run the test with version 111 shows below. I have no version in my computer such that starts with 111..
Scenario: User adds new quick work order to employee from website # src/test/java/Features/5NewQuickJobOrder.feature:12
Starting ChromeDriver 111.0.5563.19 (378a38865270d286695aeb86f190564911ef7bc2-refs/branch-heads/5563#{#251}) on port 40758
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
I do not use any chromedriver exe in my project folder, I directly use setup and driver intsance.
public static WebDriver initialize_Driver(String browser) {
properties = ConfigReader.getProperties();
if (browser.equals("Chrome")) {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
}
#Before
public void before() {
String browser = Reporter.getCurrentTestResult().getTestContext().getCurrentXmlTest().getParameter("browser");
properties = ConfigReader.initialize_Properties();
driver = DriverCreater.initialize_Driver(browser);
}
I will be very glad, if you could help me!
First the solution
To instantiate a specific browser version of ChromeDriver you can use:
WebDriverManager.chromedriver().driverVersion("111.0.5563.19").setup();
Details
This error message...
org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 111
...implies that SessionNotCreatedException was raised as ChromeDriver was unable to spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chrome=110.0.5481.97
But you are using chromedriver=111.0.5563.19
Release Notes of chromedriver=111.0 clearly mentions the following :
Supports Chrome version 111
So there is a clear mismatch between chromedriver=111.0 and the chrome=110.0
Solution
Ensure that:
ChromeDriver is downgraded to ChromeDriver v110.0 level.
Chrome Browser is updated to current chrome=110.0 (as per chromedriver=110.0 release notes).
Selenium is upgraded to current released Version 4.8.0.
I recently cloned the latest version of serenity-cucumber-starter from https://github.com/serenity-bdd/serenity-cucumber-starter. I took the action-classes branch (as I want to use that as a starting point rather than the screenplay (master) branch) and ran mvn clean verify as instructed in the readme. I got an unusual situation wherein the webdrivermanager that comes with serenity recognised and downloaded the correct version of chromedriver based on my installed chrome but serenity proceeded to start a different version of chromedriver.
Here are the logs:
11:36:55.771 [pool-2-thread-1] INFO n.s.c.w.d.ChromeDriverProvider - Using automatically driver download
11:36:56.248 [pool-2-thread-1] INFO i.g.bonigarcia.wdm.WebDriverManager - Using chromedriver 107.0.5304.62 (since Chrome 107 is installed in your machine)
11:36:56.258 [pool-2-thread-1] INFO i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /Users/user69/.m2/repository/webdriver/chromedriver/mac64/107.0.5304.62/chromedriver
11:36:56.772 [pool-2-thread-1] INFO n.s.c.w.d.ProvideNewDriver - Instantiating driver
11:36:56.774 [pool-2-thread-1] INFO n.s.c.w.d.ProvideNewDriver - Driver capabilities: Capabilities {acceptInsecureCerts: false, browserName: chrome, chrome.switches: --start-maximized;--test-ty..., goog:chromeOptions: {args: [--start-maximized, --test-type, --no-sandbox, --ignore-certificate-errors;\n, --disable-popup-blocking, --disable-default-apps, --disable-extensions-file-a..., --incognito, --disable-infobars, --disable-gpu, --headless], extensions: []}, loggingPrefs: org.openqa.selenium.logging...}
Starting ChromeDriver 90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430#{#429}) on port 48795
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Of course because the wrong version of ChromeDriver starts the tests fail to run with the following:
Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (session not created: This version of ChromeDriver only supports Chrome version 90
Current browser version is 107.0.5304.110 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
After webdrivermanager correctly identifies and downloads the correct version of chromedriver how can I instruct serenity to actually use the downloaded version rather than starting some other version?
The bonigarcia library uses the following commands to identify your installed browser version and that's the version it will automatically download.
https://github.com/bonigarcia/webdrivermanager/blob/master/src/main/resources/commands.properties
You may override the driver version serenity is using with the wdm.* properties listed under the advanced configuration section here. https://bonigarcia.dev/webdrivermanager/#advanced-configuration
E.g. pass as environment variable when using maven "mvn clean verify -Dwdm.chromeDriverVersion=107"
But, under normal circumstances you don't need to do so, if automatic driver resolution works.
I have been trying to setup automation testing for our openfin application using the below repo as base
https://github.com/openfin/webinar-automated-integration-tests
I am using Openfin (Chrome version 61.0.3163.100) and Chromedriver 2.40.565498
When I run "npm test", the openfin application opens up. But the tests don't run. After waiting for sometime, it throws the below error in console.
ERROR: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
chrome
I tried using other versions of chromedriver like 2.33, 2.34, 2.37, 2.38, 2.39, 2.41. Using these versions even the application doesn't appear. So, I guess the chromedriver version I am using is correct. I have also tried adding the below arguments to chromeOptions
--remote-debugging-port=9222,--no-sandbox,--headless,--disable-gpu
They didn't solve my issue. Not sure what is causing the issue. Any help would be much appreciated. Thanks in advance. Cheers!
This error message...
ERROR: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.40
Release Notes of chromedriver=2.40 clearly mentions the following :
Supports Chrome v66-68
Presumably you are using chrome=61.0
Release Notes of ChromeDriver v2.33 clearly mentions the following :
Supports Chrome 60-62
Your Selenium Client version is unknown to us.
So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v60.0
Solution
Ensure that:
Selenium is upgraded to current levels Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v80.0 level.
Chrome is updated to current Chrome Version 80.0 level. (as per ChromeDriver v80.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
When trying to call Sendkeys method in selenium webdriver it is displaying below error:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64) (WARNING: The server did not provide any stacktrace information)
Selenium Jarversion: 3.10.0
The error says it all :
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64)
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.27
Release Notes of chromedriver=2.27 clearly mentions the following :
Supports Chrome v54-56
You are using chrome=65.0
Release Notes of ChromeDriver v2.36 clearly mentions the following :
Supports Chrome v65-66
Your Selenium Client version is 3.10.0.
Your JDK version is unknown to us.
So there is a clear mismatch between the ChromeDriver version (v2.27) and the Chrome Browser version (v65.0)
Solution
Upgrade ChromeDriver to ChromeDriver v2.36 level.
Keep Chrome version at Chrome v65.x levels. (as per ChromeDriver v2.36 release notes)
Clean your Project Workspace and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Chrome version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Chrome.
Execute your #Test.
An older version of the ChromeDriver is being spun off when the test is being run; to remedy:
Ensure that you've gotten your browser up to date (v65-67) and get the latest version of the ChromeDriver executable(v2.38)
Extract the ChromeDriver and explicitly set the System property when initializing the ChromeDriver object...
Ex:
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver.exe");
WebDriver driver = new ChromeDriver();
I had encountered the same issue. The issue got resolved by updating the chromedriverexe. please check the compatibility of your chrome browser with chrome driver here To download chromedriver
My os is centos6.5
Download chrome27 old version and can run succeeded google-chrome
(google-chrome:8623): Gtk-WARNING **: cannot open display: )
Download chromedriver 2.10 version
By https://code.google.com/p/chromedriver/issues/detail?id=361 setup chromedriver
and run chromedriver (./chromedriver), but show:
/opt/google/chrome/google-chromedriver: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /opt/google/chrome/google-chromedriver)
What should I do?
If your issue is just this error -> "Gtk: cannot open display" Which means it can not find display attached with device so if you have connected display you can export its address. generally it will be 0.0 So your command will be like "export DISPLAY=:0.0" if doesn't work try changing 0.0 to 0 then it can find the display and then it will start on GUI.