gpt4 book ai didi

webdriver-io - 安装后 WebdriverIO Chromedriver 服务失败

转载 作者:行者123 更新时间:2023-12-01 23:07:11 31 4
gpt4 key购买 nike

我是 webdriverIO 的初学者。在网络驱动程序 IO 文档的帮助下,我开始使用 TestRunner。我安装了 node 并得到了对这个命令的预期响应

./node_modules/.bin/wdio --help

我使用

定义了配置
 ./node_modules/.bin/wdio config

但是当我运行的时候

./node_modules/.bin/wdio wdio.conf.js

它给我以下错误

Error: Couldn't initialise launcher from service "chromedriver".
Error: Cannot find module 'chromedriver'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/userName/node_modules/wdio-chromedriver-service/build/launcher.js:9:21)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Launcher.getLauncher (/Users/userName/node_modules/webdriverio/build/lib/launcher.js:815:35)
at Launcher._callee$ (/Users/userName/node_modules/webdriverio/build/lib/launcher.js:234:49)
at tryCatch (/Users/userName/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/userName/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/userName/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/userName/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/userName/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at new Promise (<anonymous>)
at new F (/Users/userName/node_modules/webdriverio/node_modules/core-js/library/modules/_export.js:36:28)
at Launcher.<anonymous> (/Users/userName/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)

最佳答案

我以前遇到过这个问题。它归结为 wdio-chromedriver-service 没有安装 chromedriver 作为依赖项。

要解决此问题,只需运行:npm i chromedriver --save-dev

关于webdriver-io - 安装后 WebdriverIO Chromedriver 服务失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51349436/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com