Skip to content

Instantly share code, notes, and snippets.

@AlfredoCasado
Created November 21, 2010 00:15
Show Gist options
  • Save AlfredoCasado/708300 to your computer and use it in GitHub Desktop.
Save AlfredoCasado/708300 to your computer and use it in GitHub Desktop.
public class GoogleSearchTest {
private DefaultSelenium selenium;
@Before
public void startSeleniumClient() {
selenium = new DefaultSelenium("localhost", 4444, "firefox", "http://www.google.com");
selenium.start();
}
@After
public void stopSeleniumClient() {
selenium.stop();
}
@Test
public void googleSearch() {
selenium.open("http://www.google.com/webhp");
selenium.type("q", "Selenium OpenQA");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
assertEquals("Selenium OpenQA - Google Search", selenium.getTitle());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment