2
votes

I have the following code:

require "rubygems"
require "watir-webdriver"
browser = Watir::Browser.new(:chrome)
browser.goto "http://google.com"

When i run this code, the browser opens the site google.com and then closes automatically Why does it close automatically? My chrome version is 12.0.742.68

1
OS (Windows, Mac, Linux...)? watir-webdriver version? Any error messages? - Željko Filipin
OS is Windows 7, Watir-webdriver 0.2.3, No error message is displayed. This is the only message that is displayed Started ChromeDriver port=34882 - Chandiran
See this other SO thread from a little while ago, it sounds like the exact same sort of issue stackoverflow.com/questions/6073559/… - Chuck van der Linden
Also met this issue today. OS: Windows Browser: Chrome 12.0.742.112 Error msg: Only "Started ChromeDriver port=29948" is displayed. - zhongxiao37
I suggest that you tag this with webdriver and/or selenium tags too, maybe webdriver/selenium people will be able to help. - Željko Filipin

1 Answers

3
votes

The Chrome driver will close all browser instances when your program exits. It's a known issue, and its priority was fortunately bumped today - look for a fix soon.