本文介绍了通过Nightwatch运行Selenium Server时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm attempting to run a simple test script. But I receive the following error:

我的夜视配置文件设置如下:

I have my nightwatch config file setup as so:

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.有人可以帮我了解可能是什么问题吗?谢谢!

The server path and chromedriver path are accurate and the most recent copy. I also have the latest version of chrome installed. Can someone please help me understand what could be the problem? Thanks!

编辑:同样,我也重新启动了整个计算机.

I've also restarted the whole computer, same issue.

推荐答案

它写得很清楚,您的chrome版本低于chromedriver所需的版本,只需将您的chrome更新为最新版本

It is written very clear , your chrome version is lower than what chromedriver needs, just update your chrome to the latest version

这篇关于通过Nightwatch运行Selenium Server时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 21:44