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

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

2012-09-08 
Selenium-webdriver系列教程(16)————为firefox设置代理下面的代码可以帮助你实现firefox测试运行时代理配

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 = proxydriver = Selenium::WebDriver.for :firefox, :profile => profile

热点排行