Skip to content

Instantly share code, notes, and snippets.

@zdwolfe
Last active October 18, 2015 20:22
Show Gist options
  • Save zdwolfe/d7acf01ccbccdf9db5d3 to your computer and use it in GitHub Desktop.
Save zdwolfe/d7acf01ccbccdf9db5d3 to your computer and use it in GitHub Desktop.
interface SearchEngine {
static void preparePage(WebDriver driver);
}
class DefaultSearchEngine implements SearchEngine {
static void preparePage(WebDriver driver) {
// do nothing
}
}
class DuckDuckGo implements SearchEngine {
static void preparePage(WebDriver driver) {
WebElement adCloseButton = driver.findElement(By.id('mainAdCloseButton'));
adCloseButton.click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment