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

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

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
posted @ 2011-10-30 13:08  乙醇  阅读(2465)  评论(1编辑  收藏  举报

友情链接 虫师的blog  测试教程网  重定向科技  省略