using ruby test and selenium grid how can I keep the same browser window for multiple tests?
- by George Horlacher
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?