Selenium 浏览器配置

Selenium2测试脚本怎样配置不同的浏览器

爱⌒轻易说出口 提交于 2020-03-03 10:57:35
一、 谷歌浏览器配置 当谷歌浏览器打不开,则要下载驱程chromedriver.exe,再添加setProperty,具体参数写法参考以下: //chrome System. setProperty ("webdriver.chrome.driver","D:/Program Files (x86)/webdriver/chromedriver.exe"); driver = new ChromeDriver(); 谷歌驱程下载地址: https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver https://chromedriver.storage.googleapis.com/index.html 二、 火狐浏览器配置 当使用火狐浏览器,运行代码,报以下错误: org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN8_1 Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700' System info: host: