开富安论坛

标题: chrome driver电脑安装包 [打印本页]

作者: admin    时间: 2025-4-1 21:09
标题: chrome driver电脑安装包
chromeDriver.exe工具是专为驱动谷歌浏览器开发的电脑驱动软件,可以进行自动化测试,随时进行测试谷歌浏览器,方便用户去使用谷歌浏览器。
chrome driver官方版简介
Command duration or timeout: 0 milliseconds

ChromeDriver是Chromium team开发维护的,它是实现WebDriver有线协议的一个单独的服务。ChromeDriver通过chrome的自动代理框架控制浏览器,ChromeDriver只与12.0.712.0以上版本的chrome浏览器兼容。


软件使用
1、下载ChromeDriver驱动包(下载地址: http://chromedriver.storage.googleapis.com/index.html?path=2.7/

注意阅读note.txt下载与自己所使用浏览器一致版本的驱动包。

2、指定ChromeDriver所在位置,可以通过两种方法指定:

1)通过配置ChromeDriver.exe位置到path环境变量实现。

2)通过webdriver.chrome.driver.系统属性实现。实现代码如下:

            
               
                    
                    
                                        软件标签:
                                                谷歌软件
                                                chromedriver
                                            

                                       
System.setProperty("webdriver.chrome.driver", "C:\\Documents and Settings\\Administrator\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chromedriver.exe");

3、最后需要做的就是创建一个新的ChromeDriver的实例。

WebDriver driver = new ChromeDriver();

至此我们就可以通过chrome浏览器来执行我们的自动化代码了。
错误说明
运行selenium自动化脚本报错如下:

org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'

  (Session info: chrome=65.0.3325.162)

  (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)

这个错误的意思就是你的chromedriver版本与你的chrome版本不匹配啦。
驱动下载地址如下
driver.get("http://www.baidu.com/")

http://chromedriver.storage.googleapis.com/index.html
                                    

               

            
               
                    
                                            
               

               
                    
                        
                        
                                                                                    chrome driver电脑安装包


                           




欢迎光临 开富安论坛 (http://www.kaifuan.com/) Powered by Discuz! X3