【问题标题】:Error when running Selenium Server via Nightwatch通过 Nightwatch 运行 Selenium Server 时出错
【发布时间】:2016-11-06 20:43:40
【问题描述】:

我正在尝试运行一个简单的测试脚本。但我收到以下错误:

我的 nightwatch 配置文件设置如下:

nightwatch.conf.js

module.exports = {
  "src_folders": [
    "tests"// Where you are storing your Nightwatch e2e/UAT tests
  ],
  "output_folder": "./reports", // reports (test outcome) output by nightwatch
  "selenium": { 
    "start_process": true, // tells nightwatch to start/stop the selenium process
    "server_path": "./node_modules/selenium-standalone/.selenium/selenium-server/2.53.1-server.jar",
    "host": "127.0.0.1",
    "port": 4444, // standard selenium port
    "cli_args": {       "webdriver.chrome.driver" : "./node_modules/selenium-standalone/.selenium/chromedriver/2.25-x64-chromedriver"
    }
  },
  "test_settings": {
    "default": {
      "screenshots": {
        "enabled": true, // if you want to keep screenshots
        "path": './screenshots' // save screenshots here
      },
      "globals": {
        "waitForConditionTimeout": 5000 // sometimes internet is slow so wait.
      },
      "desiredCapabilities": { // use Chrome as the default browser for tests
        "browserName": "chrome"
      }
    },
    "chrome": {
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true // set to false to test progressive enhancement
      }
    }
  }
}

guinea-pig.js

module.exports = { // addapted from: https://git.io/vodU0
  'Guinea Pig Assert Title': function(browser) {
    browser
      .url('https://saucelabs.com/test/guinea-pig')
      .waitForElementVisible('body')
      .assert.title('I am a page title - Sauce Labs')
      .saveScreenshot('ginea-pig-test.png')
      .end();
  }
};

服务器路径和chromedriver路径准确,最新副本。我还安装了最新版本的 chrome。有人可以帮我理解可能是什么问题吗?谢谢!

编辑:我也重新启动了整个计算机,同样的问题。

【问题讨论】:

    标签: selenium selenium-webdriver webdriver selenium-chromedriver nightwatch.js


    【解决方案1】:

    尝试使用最新版本的 Selenium 独立服务器 v.3.0.1

    如果这不起作用,那么您可以将您的 chromedriver 升级到最新版本并进行测试。你可以在这里找到不同的版本:

    https://chromedriver.storage.googleapis.com/index.html

    同时确保您使用的是最新版本的 Nightwatch v0.9.9 并在您的 package.json 文件中更新它。

    【讨论】:

      【解决方案2】:

      写的很清楚,你的chrome版本比chromedriver需要的低,把你的chrome更新到最新版本就行了

      【讨论】:

        猜你喜欢
        • 2020-06-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-31
        • 2015-04-07
        • 2023-03-22
        • 2019-08-29
        相关资源
        最近更新 更多