Skip to content

Instantly share code, notes, and snippets.


Freek Wielstra fwielstra

View GitHub Profile
fwielstra /
Created May 16, 2011
An example of a Selenium WebRunner test
public void runSomeIntegrationTest() {
WebDriver driver = new FirefoxDriver()
Selenium selenium = new WebDriverBackedSelenium(driver, SharedConfiguration.BASE_URL);"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
public class WebDriverSupplier {
private static final Supplier<WebDriver> FIREFOX_SUPPLIER = new Supplier<WebDriver>() {
private WebDriver firefoxDriver;
public WebDriver get() {
if (firefoxDriver == null) {
firefoxDriver = new FirefoxDriver();