怎么将chromedriver.exe位置到path环境变量实现
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么将chromedriver.exe位置到path环境变量实现相关的知识,希望对你有一定的参考价值。
在gem 安装完watir-webdriver后,默认情况下chrome浏览器的支持是没有安装上的。所以如果要使用webdriver测试chrome的话,需要手动安装chrome支持。
RequirementsThe 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'
1、打开电脑,在电脑桌面上,右击我的电脑,选择属性
2、在我的电脑属性中,左击高级系统设置
3、弹出系统属性对话框
4、点击环境变量,在系统变量中找到path,然后编辑
5、弹出编辑系统变量的对话框,将你的路径拷贝到里面即可(注意要加分号)
RequirementsThe 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'本回答被提问者采纳
以上是关于怎么将chromedriver.exe位置到path环境变量实现的主要内容,如果未能解决你的问题,请参考以下文章