Tuesday, July 13, 2010

Quit completely when emulating Selenium API in WebDriver

Once you Emulating Selenium API in WebDriver code, you need to quit your service like this separately:
driverInstance.close();
selenium.stop();


......
String baseUrl = driver.getCurrentUrl();

Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl);

selenium.open("http://www.google.com.hk/");


WebDriver driverInstance =
((WebDriverBackedSelenium)selenium).getUnderlyingWebDriver();

googlesearchpage.searchfor(driverInstance, "Gmail");

driverInstance.close();
selenium.stop();
......

No comments:

Post a Comment