问题
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:
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.
来源:https://stackoverflow.com/questions/6176526/chrome-browser-opens-and-closes-using-watir-webdriver