我尝试使用我的代码通过 watir-webdriver 打开 Internet Explorer:
require "watir-webdriver"
profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new :http => 'http://username:password@xx.xxx.xxx.xx:xxxxx', :ssl => 'http://username:password@xx.xxx.xxx.xx:xxxxx'
我得到这个错误,说明我猜的一些东西?它是这样写的:
C:/Ruby/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/profile.rb:205:in `Integer': invalid value for Integer(): "//username:password@xx.xxx.xxx.xx:xxxxx" (ArgumentError)
from C:/Ruby/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/profile.rb:205:in `set_manual_proxy_preference'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/profile.rb:176:in `proxy='
from test1.rb:6:in `<main>'