无法解决依赖性-webdriverIO

时间:2020-09-26 21:12:29

标签: javascript node.js selenium-webdriver npm webdriver-io

我正在尝试使用( npm run test-local )运行我的WebdriverIo规范,并且即使我在package.json中具有所有依赖项,也遇到以下错误< / p>

[0-2]错误:无法创建会话。 转发新会话时出错,无法使用虚拟机虚拟机池设置功能{browserName:chrome,goog:chromeOptions:{}} *

npm WARN grunt-webdriver@3.0.0需要一个对等体@ wdio / cli @ ^ 5.1.0,但未安装。您必须自己安装对等依赖项。 npm WARN grunt-webdriver@3.0.0需要一个webdriverio@^5.1.0的对等节点,但未安装。您必须自己安装对等依赖项。 npm WARN wdio-chromedriver-service@6.0.4需要chromedriver @ 的对等方,但未安装。您必须自己安装对等依赖项 *


"scripts": {
    "allure:history": "mkdir -p allure-report/history ./test/reports/allure-results/history && cp -a allure-report/history ./test/reports/allure-results/",
    "allure-report": "node_modules/.bin/allure generate --clean ./test/reports/allure-results && allure open",
    "junit-report": "node_modules/.bin/junit-viewer --results=./test/reports/junit-results --save=junit-results.html && open junit-results.html",
    "test-sauce": "wdio ./test/config/wdio.sauce.conf.js",
    "test-browserstack": "wdio ./test/config/wdio.browserstack.conf.js",
    "test-local": "npm run allure:history && wdio ./test/config/wdio.local.conf.js",
    "test-mobile": "wdio ./test/config/wdio.appium.conf.js"
  },
"dependencies": {},
  "devDependencies": {
    "@babel/cli": "^7.8.4",
    "@babel/core": "^7.9.0",
    "@babel/plugin-syntax-export-default-from": "^7.8.3",
    "@babel/preset-env": "^7.9.0",
    "@babel/register": "^7.9.0",
    "@wdio/allure-reporter": "^6.4.7",
    "@wdio/appium-service": "^6.4.7",
    "@wdio/browserstack-service": "^6.4.7",
    "@wdio/cli": "^6.0.5",
    "@wdio/junit-reporter": "^6.4.7",
    "@wdio/local-runner": "^6.0.5",
    "@wdio/mocha-framework": "^6.4.7",
    "@wdio/sauce-service": "^6.0.4",
    "@wdio/selenium-standalone-service": "^6.1.4",
    "@wdio/spec-reporter": "^6.0.4",
    "@wdio/sync": "^6.0.1",
    "allure-commandline": "^2.13.0",
    "babel-plugin-source-map-support": "^2.1.3",
    "eslint": "^7.2.0",
    "eslint-config-standard": "^14.1.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "grunt": "^1.3.0",
    "grunt-cli": "^1.3.2",
    "grunt-mocha": "^1.2.0",
    "grunt-webdriver": "^3.0.0",
    "junit-viewer": "^4.11.1",
    "node-excel-to-json": "0.0.3",
    "selenium-standalone": "^6.20.0",
    "underscore": "^1.11.0",
    "wdio-chromedriver-service": "^6.0.2",
    "wdio-json-reporter": "^2.0.0"
  }

1 个答案:

答案 0 :(得分:0)

确保硒独立服务器已启动并正在运行

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -browser "browserName=chrome,maxinstance=1

上面的命令对我有用!