Selenium: reuse existing browser session, instead of opening new windows?
This has been asked a million times on the web, but there's no clear cut answer. I tried "-browserSessionReuse" today without any luck; my tests keep spawning new browser windows.
X:\QA\Automation\SELENIUM_SERVER>java -jar selenium-server-standalone-2.8.0.jar -log "log.txt" -browserSessionReuse -forcedBrowserMode "*googlechrome" <snip> 13:42:25.923 INFO - Will recycle browser sessions when possible.
Maybe it's how I'm starting Selenium in my .py files?
sel = selenium('localhost', 4444, "*chrome", 'http://server/') sel.start()
...perhaps I'm doing too many server starts?
I've had the same result, and I wanted reuse at one point to check cookie values in a site test.
This is possible with Selenium 2 and WebDriver. I'm not sure if it is with different versions. In Selenium 2 with WebDriver you can call
webDriver = new FirefoxDriver()which spawns a browser, and that browser will stay open for the duration of your testing, or you can choose to close it with
I like to close my browser window between tests so that I know my tests aren't "dirty" with stored session data that could affect how the tests run, but I can see value in some targeted tests, where I want to try a couple different scenarios while keeping the same session going.
Funny, I was just reading about this this morning, and I think it will solve my browser windows problem. Thank you.