Skip to content

Instantly share code, notes, and snippets.

@sebastiandeutsch
Created November 29, 2009 18:34
Show Gist options
  • Save sebastiandeutsch/245005 to your computer and use it in GitHub Desktop.
Save sebastiandeutsch/245005 to your computer and use it in GitHub Desktop.
I created a world object
module WebDriver
@@browser = nil
def self.extended(base)
@@browser = Selenium::WebDriver.for :firefox if @@browser.nil?
end
at_exit do
@@browser.quit
end
def browser
@@browser
end
end
the at_exit method is whining a little
/Library/Ruby/Gems/1.8/gems/selenium-webdriver-0.0.7/firefox/src/rb/lib/selenium/webdriver/firefox/extension_connection.rb:51:in `close': closed stream (IOError)
from /Library/Ruby/Gems/1.8/gems/selenium-webdriver-0.0.7/firefox/src/rb/lib/selenium/webdriver/firefox/extension_connection.rb:51:in `quit'
from /Library/Ruby/Gems/1.8/gems/selenium-webdriver-0.0.7/firefox/src/rb/lib/selenium/webdriver/firefox/bridge.rb:29:in `quit'
from /Library/Ruby/Gems/1.8/gems/selenium-webdriver-0.0.7/common/src/rb/lib/selenium/webdriver/driver.rb:70:in `quit'
from ./features/support/paths.rb:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment