我们如何使用firefox watir在Selenium web驱动程序中使用私有代理用户名和密码

时间:2018-04-05 12:56:20

标签: ruby firefox watir

我在Firefox中使用Watir和Selenium配置我的配置是: -

   profile = Selenium::WebDriver::Firefox::Profile.new
   profile["network.proxy.type"] = 1
   profile["network.proxy.http"] = ENV['PROXY_IP']
   profile["network.proxy.ssl"] = ENV['PROXY_IP']
   profile["network.proxy.http_port"] = ENV['PROXY_PORT'].to_i
   profile["network.proxy.ssl_port"] = ENV['PROXY_PORT'].to_i

   options = Selenium::WebDriver::Firefox::Options.new(profile: profile)
   driver = Selenium::WebDriver.for :firefox,  options: options
   browser = Watir::Browser.new  driver
   browser.goto url

0 个答案:

没有答案