Created
May 16, 2011 09:14
-
-
Save fwielstra/974127 to your computer and use it in GitHub Desktop.
An example of a Selenium WebRunner test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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