小编典典

量角器/selenium“在以下位置找不到chromedriver”(在Windows上)

selenium

我按照本教程安装了量角器,当我使用webdriver-manager更新时,它说:

selenium standalone is up to date.
chromedriver is up to date.

您在我尝试进行量角器测试时说:

C:\Users\****\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\local.dp.js:42
            throw new Error('Could not find chromedriver at ' +
                  ^
    Error: Could not find chromedriver at C:\Users\****\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe
        at LocalDriverProvider.addDefaultBinaryLocs_ (C:\Users\****\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\local.dp.js:42:15)
        at LocalDriverProvider.setupEnv (C:\Users\****\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\local.dp.js:59:8)
        at Runner.run (C:\Users\****\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:308:31)
        at process.<anonymous> (C:\Users\****\AppData\Roaming\npm\node_modules\protractor\lib\runFromLauncher.js:32:14)
        at process.EventEmitter.emit (events.js:98:17)
        at handleMessage (child_process.js:318:10)
        at Pipe.channel.onread (child_process.js:345:11)
    [launcher] Runner Process Exited With Error Code: 8

我检查了 local.dp.js ,发现它试图从 .. \ node_modules \ protractor \ selenium \
chromedriver加载chromedriver,
但是只有一个空的zip文件 chromedriver_2.9

因此,我手动下载了chromedriver并将其复制到此位置,从而产生了新错误:

C:\Users\****\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1549
      throw error;
            ^
Error: Server exited with 1
    at Error (<anonymous>)
    at ChildProcess.onServerExit (C:\Users\****\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\remote\index.js:193:11)
    at ChildProcess.g (events.js:180:16)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:797:12)
[launcher] Runner Process Exited With Error Code: 8

任何人有想法吗?


阅读 340

收藏
2020-06-26

共1个答案

小编典典

如果您位于代理之后,请尝试先设置代理,然后运行webdriver update:

npm config set proxy http://<proxy.com>:port

webdriver-manager update
2020-06-26