您的位置:首页 > 其它

Selenium-webdriver系列教程(16)————为firefox设置代理

2014-11-06 11:26 645 查看
下面的代码可以帮助你实现firefox测试运行时代理配置的功能。大概的思路是通过设置profile对象来进行配置。

[ruby]
view plaincopyprint?

profile = Selenium::WebDriver::Firefox::Profile.new  
# 新建了url为proxy.org,端口为8080的htpp代理   
proxy = Selenium::WebDriver::Proxy.new(:http => "proxy.org:8080")  
profile.proxy = proxy  
   
driver = Selenium::WebDriver.for :firefox, :profile => profile 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: