如何安装webdriver chrome浏览器支持

在gem 安装完watir-webdriver后,默认情况下chrome浏览器的支持是没有安装上的。
所以如果要使用webdriver测试chrome的话,我们需要手动安装chrome支持。

Requirements
The ChromeDriver controls the browser using Chrome's automation proxy framework. Consequently, the ChromeDriver is only compatible with Chrome version 12.0.712.0 or newer.

从官方文档上可以看出,chrome driver只支持chrome12.0712以上的版本。

万事俱备后,首先下载chrome driver
将下载好的chromedriver.exe放在环境变量所配置的文件夹中。

使用下面的代码测试chrome driver是否安装完成:

#使用watir-webdriver语法
#安装成功后则可以启动chrome并打开腾讯首页
@browser = Watir::Browser.new :chrome
@browser.goto 'www.qq.com' 

Requirements
The ChromeDriver controls the browser using Chrome's automation proxy framework. Consequently, the ChromeDriver is only compatible with Chrome version 12.0.712.0 or newer.

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。