Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
An example of a Selenium WebRunner test
@Test
public void runSomeIntegrationTest() {
WebDriver driver = new FirefoxDriver()
Selenium selenium = new WebDriverBackedSelenium(driver, SharedConfiguration.BASE_URL);
selenium.open("page.html");
// wait until the table row has been loaded
SeleniumUtils.waitForElementPresent(selenium, "xpath=//tr[@id='task-TASK_001']");
// navigate to the associated details page
SeleniumUtils.clickElement(driver, By.linkText("1001"));
// the browser now opens the details.html page
// wait until the page has been loaded
SeleniumUtils.waitForElementPresent(selenium, "xpath=//tr[@id='wo-1001']");
// do an assertion
assertEquals("CANCELLED", selenium.getText("xpath=//tr[@id='wo-1001']/td[3]"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment