首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Selenium2中设定FirefoxDriver的起步路径和Profile

2012-07-15 
Selenium2中设定FirefoxDriver的启动路径和Profile# 火狐启动路径如果安装了多个Firefox版本,若在创建Fire

Selenium2中设定FirefoxDriver的启动路径和Profile
# 火狐启动路径
如果安装了多个Firefox版本,若在创建FirefoxDriver时不指定路径,则启动安装在默认路径下的Firefox浏览器,C:\Program Files\Mozilla Firefox\firefox.exe

FirefoxProfile profile = new FirefoxProfile(new File("D:\\daniel\\FirefoxProfile\"));WebDriver webDriver = new FirefoxDriver(profile);


另,创建新的Profile可以在Run中输入 firefox.exe -p 在打开的Profile Manager中管理profile,详情可参考:http://support.mozilla.org/zh-CN/kb/%E7%AE%A1%E7%90%86%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6

热点排行