Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
703 views
in Technique[技术] by (71.8m points)

selenium - Chromedriver error "Chrome version must be >= 52" using Nightwatch

I'm trying to setup Nightwatch, and am using the latest chromedriver which 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's everything that I'm using:

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 nightwatch:

./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 like this:

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
  (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)
Command duration or timeout: 1.42 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
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'
Driver info: org.openqa.selenium.chrome.ChromeDriver',
     suppressed: [],
     localizedMessage: 'unknown error: Chrome version must be >= 52.0.2743.0
  (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)
Command duration or timeout: 1.42 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
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'
Driver 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: '
Driver info: org.openqa.selenium.chrome.ChromeDriver',
     hCode: 1299270263,
     screen: null },
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1144687147 }

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 my actual chrome?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Does chromedriver use my local copy of chrome? Do I need to update my actual chrome?

Yes, ChromeDriver is a executable that selenium webdriver uses to control chrome.

So selenium webdriver launch your installed chrome from your default location or custom location which you tell to selenium webdriver during initialising ChromeDriver.

So basically ChromeDriver executable just use to talking between chrome browser and selenium webdriver to control it that doesn't mean it launches their own chrome browser. It uses your installed chrome browser.

So yes, you need to update your actual installed chrome.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...