Issue
We've been running integration tests successfully against Ruby on Rails 2 using Selenium on both Google Chrome and Firefox. However, we've recently upgraded to Ruby on Rails 3 and are running into issues creating a Google Chrome webdriver instance.
When we attempt to create, we get the following stack:
irb(main):002:0> profile = Selenium::WebDriver::Chrome::Profile.new
translate])#<Selenium::WebDriver::Chrome::Profile:0x64f2fd0 @extensions=[], @model=nil>
irb(main):003:0> profile['download.prompt_for_download'] = false
false
irb(main):004:0> driver = Selenium::WebDriver.for(:chrome, :profile => profile, :switches => %w[--ignore-certificate-errors --disable-popup-blocking --disable-translate])
ArgumentError: wrong number of arguments (0 for 1)
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/platform.rb:157:in `open'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/platform.rb:157:in `ip'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/platform.rb:170:in `interfaces'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/port_prober.rb:23:in `free?'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/port_prober.rb:5:in `above'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/chrome/service.rb:33:in `default_service'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/chrome/bridge.rb:14:in `initialize'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/driver.rb:37:in `new'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver/common/driver.rb:37:in `for'
from /var/www/myapp/shared/bundle/ruby/1.8/gems/selenium-webdriver-2.27.2/lib/selenium/webdriver.rb:67:in `for'
from (irb):4
Any tips?
Solution
I saw this when I had included a gem which included the backports gem as part of its dependencies into my Gemfile. The backports gem rewrites some Ruby 1.8 internals, which overwrote parts of the UDPSocket
core class. Try getting rid of the backports gem and giving it a shot.
Answered By - techpeace
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.