错误:无法连接到WebDriver。未知错误:未知错误:Chrome无法启动:崩溃(硒)

时间:2019-10-15 08:25:26

标签: selenium

enter image description here

package.json

{
  "name": "auto-qa",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "create": "codeceptjs g:test",
    "test": "codeceptjs run --steps --verbose "
  },
  "keywords": [],
  "author": "Yarik",
  "license": "ISC",
  "engines": {
    "node": "10.16.1",
    "npm": "6.10.2"
  },
  "dependencies": {
    "@wdio/selenium-standalone-service": "5.11.2",
    "chromedriver": "^77.0.0",
    "codeceptjs": "2.2.1",
    "cross-env": "5.2.0",
    "dotenv": "8.0.0",
    "webdriverio": "5.11.11"
  }
}

配置文件:

require("dotenv").config();

exports.config = {
  tests: "./tests/**/*.js",
  output: "./output",
  helpers: {
    WebDriver: {
      url: process.env.DEFAULT_HOST,
      browser: process.profile || process.env.DEFAULT_BROWSER,
      coloredLogs: true,
      waitForTimeout: 10000
    }
  },
  include: {
    I: "./steps_file.js"
  },
  bootstrap: null,
  mocha: {},
  name: "auto-qa",
  plugins: {
    wdio: {
      enabled: true,
      services: ["selenium-standalone"]
    },
    autoDelay: {
      enabled: true
    }
  }
};

当我尝试运行此命令"test": "codeceptjs run --steps --verbose "时,出现错误,就像您在顶部的图片附件中看到的那样。我尝试找出此问题,但找不到正确的解决方法。我在Windows上使用WSL ubuntu系统(也许与此东西有关),我已经安装了chrome,java并制作了npm install。如果您需要其他信息,请告诉我。

0 个答案:

没有答案