using ruby test and selenium grid how can I keep the same browser window for multiple tests?

Posted by George Horlacher on Stack Overflow See other posts from Stack Overflow or by George Horlacher
Published on 2010-12-21T22:52:49Z Indexed on 2010/12/21 22:54 UTC
Read the original article Hit count: 249

Filed under:
|
|
|

Each of my tests start a new selenium client browser and tear it down so they can run stand alone with this code:

def setup
  if $selenium
    @selenium = $selenium
  else
    @selenium = Selenium::SeleniumDriver.new("#$sell_server", 4444, "#$browser", "http://#$network.#$host:2086", 10000);
  @selenium.start
end
@selenium.set_context("test_login")

end

def teardown @selenium.stop unless $selenium assert_equal [], @verification_errors end

What I'd like is to run a suite of tests that all use the same browser and don't keep opening and closing new browsers for every test. I've tried using $selenium as a global object / browser but each test still opens up a new browser and closes it. How should this be done?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about testing