System.out.println("Using Chrome");
// Use technique here:
// http://code.google.com/p/selenium/wiki/ChromeDriver
ChromeDriverService service = startChromeDriverService();
driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome());
System.out.println(driver.toString());
selenium = new WebDriverBackedSelenium(driver, Config.inst().TEAMMATES_URL);
/*
* Chrome hack. Currently Chrome doesn't support confirm() yet. http://code.google.com/p/selenium/issues/detail?id=27
*/
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.confirm = function(msg){ return true;};");
} else {
System.out.println("Using " + Config.inst().BROWSER);
// iexplore, opera, safari. For some not-supported-yet browsers, we
// use
// legacy methods: Going through the RC server.
String selBrowserIdentifierString = "*" + Config.inst().BROWSER;
selenium = new DefaultSelenium("localhost", 4444, selBrowserIdentifierString, Config.inst().TEAMMATES_URL);
CommandExecutor executor = new SeleneseCommandExecutor(selenium);
DesiredCapabilities dc = new DesiredCapabilities();
driver = new RemoteWebDriver(executor, dc);
}
selenium.windowMaximize();
selenium.open("/");