SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

Cannot pass :proxy to Opera with Ruby bindings #5272

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 5272

I've been unsuccessful using Opera with the Ruby bindings, as of Selenium 2.30.0.

In its simplest invocation, I see the following:

irb(main):004:0> driver = Selenium::WebDriver.for :opera
ArgumentError: invalid proxy type: :unspecified, expected one of [:direct, :manual,
:pac, :auto_detect, :system]
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/common/proxy.rb:73:in
`type='
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/common/proxy.rb:106:in
`json_create'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/remote/capabilities.rb:145:in
`json_create'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/remote/bridge.rb:95:in
`create_session'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/remote/bridge.rb:68:in
`initialize'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/opera/bridge.rb:28:in
`initialize'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/common/driver.rb:43:in
`for'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver.rb:67:in
`for'

The Opera browser is in fact started, but the driver errors out.  Heeding the error
message, I attempted to set the proxy type, but the Opera bridge does not view the
:proxy option as a valid option and as a result, I see the following:

irb(main):005:0> driver = Selenium::WebDriver.for :opera, proxy: :direct
ArgumentError: unknown option: {:proxy=>:direct}
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/opera/bridge.rb:72:in
`create_capabilities'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/opera/bridge.rb:17:in
`initialize'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver/common/driver.rb:43:in
`for'
    from /home/nirvdrum/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/selenium-webdriver-2.30.0/lib/selenium/webdriver.rb:67:in
`for'

Reported by nirvdrum on 2013-03-04 04:26:09

lukeis commented 8 years ago
To clarify, I think there's two problems here.  One, the driver should default to a
sane proxy config (probably :system).  Two, the bridge should allow setting the proxy
if OperaDriver supports it.

Reported by nirvdrum on 2013-03-04 04:27:21

lukeis commented 8 years ago
If it helps any, the default Java options work fine:

irb(main):013:0> require './tmp/selenium-server-standalone.jar'
=> true

irb(main):014:0> driver = com.opera.core.systems.OperaDriver.new
=> #<Java::ComOperaCoreSystems::OperaDriver:0x35ccd96b>

I guess the Ruby ones just need to come into line with the Java bindings.

Reported by nirvdrum on 2013-03-04 04:32:32

lukeis commented 8 years ago
The Opera driver should work in 2.31. The second issue of not being able to set :proxy
is still present, so I'm changing the summary to reflect that.

Reported by jari.bakken on 2013-03-04 10:20:12

lukeis commented 8 years ago
You're right.  I should have tried 2.31.0 first.  That issue is indeed resolved.

Reported by nirvdrum on 2013-03-04 14:27:52

lukeis commented 8 years ago
Closing after comment 4

Reported by barancev on 2014-01-09 12:30:37

lukeis commented 8 years ago

Reported by jari.bakken on 2015-02-26 23:01:21

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:16:55