如何在Windows 7中升级chromedriver?

时间:2018-04-05 11:28:05

标签: npm selenium-chromedriver

之前我有chromedriver 2.32.498550。

  • 我删除了所有缓存(C:\Users\JHONE\AppData\Roaming\npm

  • 我安装了新版本(2.37):

命令行:

npm install -g chromedriver

痕迹:

C:\Users\JHONE>chromedriver -version
ChromeDriver 2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a)

C:\Users\JHONE>npm install -g chromedriver
C:\Users\JHONE\AppData\Roaming\npm\chromedriver -> C:\Users\JHONE\AppData\Roaming\npm\node_modules\chromedriver\bin\chromedriver

> chromedriver@2.37.0 install C:\Users\JHONE\AppData\Roaming\npm\node_modules\chromedriver
> node install.js

Downloading https://chromedriver.storage.googleapis.com/2.37/chromedriver_win32.zip
Saving to C:\Users\JHONE\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3270K total.
Extracting zip contents
Copying to target path C:\Users\JHONE\AppData\Roaming\npm\node_modules\chromedriver\lib\chromedriver
Done. ChromeDriver binary available at C:\Users\JHONE\AppData\Roaming\npm\node_modules\chromedriver\lib\chromedriver\chromedriver.exe
+ chromedriver@2.37.0
added 96 packages in 20.139s

但是我的默认版本没有改变(再次是2.32.498550):

C:\Users\JHONE>chromedriver -version
ChromeDriver 2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a)

1 个答案:

答案 0 :(得分:0)

我显示所有进程,我看到RobotFramwork运行的旧chromewebdriver.exe。我停止了这个过程,我删除了这个chromewebdriver.exe,现在它可以正常工作。

C:\Users\JHONE>chromedriver -version
ChromeDriver 2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7)

但如果我恢复此chromewebdriver.exe,请不要再次使用:

C:\Users\JHONE>chromedriver -version
ChromeDriver 2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a)