当前位置: 代码迷 >> Web前端 >> Selenium-webdriver系列课程(16)――――为firefox设置代理
  详细解决方案

Selenium-webdriver系列课程(16)――――为firefox设置代理

热度:169   发布时间:2012-09-08 10:48:07.0
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
  相关解决方案