Skip to content

Instantly share code, notes, and snippets.

@freynaud
Created May 19, 2011 11:06
Show Gist options
  • Save freynaud/980539 to your computer and use it in GitHub Desktop.
Save freynaud/980539 to your computer and use it in GitHub Desktop.
private static SeleniumServer server;
private static int port;
@BeforeClass
public static void prepare() throws Exception {
port = PortProber.findFreePort();
RemoteControlConfiguration config = new RemoteControlConfiguration();
config.setPort(port);
server = new SeleniumServer(config);
server.boot();
}
@Test
public void ff() throws MalformedURLException {
DesiredCapabilities ff = DesiredCapabilities.firefox();
WebDriver driver = null;
try {
driver = new RemoteWebDriver(new URL("http://localhost:" + port + "/wd/hub"), ff);
driver.get("https://signin.at.paradise.qa.ebay.com/ws/eBayISAPI.dll?SignIn");
Assert.assertEquals("Google", driver.getTitle());
} finally {
Reporter.log("driver : " + driver);
driver.quit();
}
}
@AfterClass
public static void stop() throws Exception {
server.stop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment