Chromedriver bug "Chrome version must be> = 52" using Nightwatch
I'm trying to set up Nightwatch , and use the latest chrome recorder that says it supports chrome v52-54 . BUT, when I try to run the tests, it says 'Error: Chrome version must be >=52.0.2743.' Here is all I use:
Project structure
|-- nightwatch.json |-- bin/ | |-- chromedriver | |-- selenium-server-standalone-2.53.1.jar |-- tests/ | |-- sample.js |-- results/ |-- screens/ |-- node_modules/ | |-- (lots of modules here) And here is my configuration file for night vision:
./nightwatch.json
{ "src_folders" : ["tests"], "output_folder" : "results", "custom_commands_path" : "", "custom_assertions_path" : "", "page_objects_path" : "", "globals_path" : "", "selenium" : { "start_process" : true, "server_path" : "bin/selenium-server-standalone-2.53.1.jar", "log_path" : "results", "host" : "127.0.0.1", "port" : 4444, "cli_args" : { "webdriver.chrome.driver" : "bin/chromedriver" } }, "test_settings" : { "default" : { "launch_url" : "http://localhost", "selenium_port" : 4444, "selenium_host" : "localhost", "silent": true, "screenshots" : { "enabled" : true, "path" : "screens/" }, "desiredCapabilities": { "browserName": "chrome", "javascriptEnabled": true, "acceptSslCerts": true } }, "chrome" : { "desiredCapabilities": { "browserName": "chrome", "javascriptEnabled": true, "acceptSslCerts": true } } } } Running tests
I run the tests as follows:
nightwatch tests/ Error
And I get the following output:
Starting selenium server... started - PID: 3500 [Sample] Test Suite ======================= Running: Demo test Google Error retrieving a new session from the selenium server Connection refused! Is selenium server started? { sessionId: null, status: 13, state: 'unhandled error', value: { message: 'unknown error: Chrome version must be >= 52.0.2743.0\n (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.2.0-56-generic x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 1.42 seconds\nBuild info: version: \'2.53.1\', revision: \'a36b8b1\', time: \'2016-06-30 17:37:03\'\nSystem info: host: \'N/A\', ip: \'N/A\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'3.2.0-56-generic\', java.version: \'1.7.0_111\'\nDriver info: org.openqa.selenium.chrome.ChromeDriver', suppressed: [], localizedMessage: 'unknown error: Chrome version must be >= 52.0.2743.0\n (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.2.0-56-generic x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 1.42 seconds\nBuild info: version: \'2.53.1\', revision: \'a36b8b1\', time: \'2016-06-30 17:37:03\'\nSystem info: host: \'N/A\', ip: \'N/A\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'3.2.0-56-generic\', java.version: \'1.7.0_111\'\nDriver info: org.openqa.selenium.chrome.ChromeDriver', buildInformation: { releaseLabel: '2.53.1', buildTime: '2016-06-30 17:37:03', class: 'org.openqa.selenium.internal.BuildInfo', buildRevision: 'a36b8b1', hCode: 1900167016 }, cause: null, systemInformation: 'System info: host: \'N/A\', ip: \'N/A\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'3.2.0-56-generic\', java.version: \'1.7.0_111\'', supportUrl: null, class: 'org.openqa.selenium.WebDriverException', additionalInformation: '\nDriver info: org.openqa.selenium.chrome.ChromeDriver', hCode: 1299270263, screen: null }, class: 'org.openqa.selenium.remote.Response', hCode: 1144687147 } Does anyone know how to resolve this error?
Chrome version must be >= 52.0.2743.0
Does chromedriver use my local copy of chrome? Do I need to update the current chrome?
Does chromedriver use my local copy of chrome? Do I need to update the current chrome?
Yes, ChromeDriver is an executable that uses selenium webdriver to control chrome.
So selenium-webdriver runs your installed chrome from your default location or the custom location that you specify selenium webdriver during the initialization of ChromeDriver .
Thus, basically the ChromeDriver executable is just used to talk between the chrome browser and the selenium web server to manage it, which does not mean that it launches its own chrome. It uses your installed Chrome browser.
So yes, you need to update your installed chrome.
Yes, ChromeDriver uses a local Chrome installation. If you donβt want to update your Chrome installation, you can specify the version of ChromeDriver that will work with the installed version of Chrome.
You can find compatible versions of Chrome for different releases of ChromeDriver at https://chromedriver.storage.googleapis.com/2.25/notes.txt (change "2.25" to a newer version if your version of Chrome is newer than what is indicated there).
If your test environment uses Node.js webdriver-manager , you can simply install the required version of ChromeDriver (keeping any versions already installed) using (for example, for version 2.20 ):
webdriver-manager update --chrome --versions.chrome=2.20 and specify the appropriate version of ChromeDriver when starting Selenium through webdriver-manager :
webdriver-manager start --versions.chrome=2.20 If webdriver-manager not available, you can simply download the required version of ChromeDriver and use some technique to pass the following parameter to the Selenium server start command:
-Dwebdriver.chrome.driver=/path/to/the/desired/chromedriver_version If you are using Ubuntu 16.04, this code works:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 64
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' x32
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' Install / Update
sudo apt-get update sudo apt-get install google-chrome-stable