使用WebDriver在Chrome浏览器上进行测试时,需要从http://chromedriver.storage.googleapis.com/index.html网址中下载与本机chrome浏览器对应的驱动程序,驱动程序名为chromedriver;
chromedriver的版本需要和本机的chrome浏览器对应,才能正常使用;
1. 首先需要查看本机的浏览器版本,如下为66.0.3359*
2. 下载对应的驱动chromedriver,下载地址:http://chromedriver.storage.googleapis.com/index.html,可看到所有chromedriver的版本
![](https://i-blog.csdnimg.cn/blog_migrate/0b6c1b017cef55bc1c6faf2863bbf92d.png)
3. 点击进入某个版本,如点击2.39,可看到此版本所有信息
![](https://i-blog.csdnimg.cn/blog_migrate/ac22a639cdc610da96626d26d37fcbed.png)
4. 点击notes.txt可以看到对应版本的信息,如下,可看到2.39支持的chrome版本为V66-68。因此,本机下载2.39版本即可。
附录:版本对应表
----------ChromeDriver v2.39 (2018-05-30)---------- Supports Chrome v66-68 Resolved issue 2436: ChromeDriver for Android does not provide useful error message for old adb version [[Pri-1]] Resolved issue 2431: ChromeDriver tests that close Windows are flaky [[Pri-1]] Resolved issue 2259: Click on component into an Iframe (with container padding > 0) is not working [[Pri-1]] Resolved issue 2161: ChromeDriver remote debug port reservation race conditions [[Pri-2]] Resolved issue 2420: Get Alert Text is not returning spec compliant error codes [[Pri-2]] Resolved issue 2369: Clean up state of androidUseRunningApp feature [[Pri-2]] Resolved issue 2406: Minimize/Maximize window need a w3c compliant endpoints [[Pri-]] ----------ChromeDriver v2.38 (2018-04-17)---------- Supports Chrome v65-67 Resolved issue 2354: The chromedriver crashes/lose connection when navigate to gmail [[Pri-0]] Resolved issue 2381: Unknown session ID and cannot determine loading status [[Pri-1]] Resolved issue 2198: ChromeDriver 2.34 doesn't wait until iframe content loads after switching into iframe [[Pri-2]] Resol