Chromedriver错误"Chrome版本必须为> = 52"使用Nightwatch [英] Chromedriver error "Chrome version must be >= 52" using Nightwatch

查看:152
本文介绍了Chromedriver错误"Chrome版本必须为> = 52"使用Nightwatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置 Nightwatch ,并且正在使用最新的chromedriver >表示支持chrome v52-54 .但是,当我尝试运行测试时,它会显示 'Error: Chrome version must be >=52.0.2743.' .这是我正在使用的所有内容:

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:

  • ChromeDriver 2.24
  • Selenium 2.53.1
  • Nightwatch v0.9.8
  • Node v6.5.0
  • Java v1.7.0_111

项目结构

|-- nightwatch.json
|-- bin/
|   |-- chromedriver
|   |-- selenium-server-standalone-2.53.1.jar
|-- tests/
|   |-- sample.js
|-- results/
|-- screens/
|-- node_modules/
|   |-- (lots of modules here)

这是我的配置文件,用于守夜人:

./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
      }
    }
  }
} 

运行测试

我这样运行测试:

nightwatch tests/

错误

我得到以下输出:

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 }

有人知道如何解决此错误吗?

Anyone know how to resolve this error?

Chrome version must be >= 52.0.2743.0

Chrome version must be >= 52.0.2743.0

chromedriver是否使用我的本地chrome副本?我需要更新我的实际Chrome吗?

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

推荐答案

chromedriver是否使用我的chrome本地副本?我需要更新我的实际Chrome吗?

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

是的, ChromeDriver 是硒的可执行文件webdriver用于控制Chrome.

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

因此,Selenium Webdriver从默认位置或自定义位置启动安装的chrome,您在初始化 ChromeDriver .

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

因此,基本上 ChromeDriver 可执行文件仅用于交谈在chrome浏览器和selenium webdriver之间进行控制,但这并不意味着它会启动自己的chrome浏览器.它使用您安装的Chrome浏览器.

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.

是的,您需要更新实际安装的Chrome.

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

这篇关于Chromedriver错误"Chrome版本必须为> = 52"使用Nightwatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆