public abstract class BaseWebPage extends Object implements WebPage
WebDriver
.
As soon as a page object is created, an explicit wait
(waitUntilIsLoaded()
) is triggered.
Any subclass should override waitUntilIsLoaded()
to implement a more meaningful wait for that page.
Modifier and Type | Field and Description |
---|---|
protected org.openqa.selenium.WebDriver |
driver |
protected static org.apache.log4j.Logger |
logger |
protected WebPage |
previousPage |
Constructor and Description |
---|
BaseWebPage(org.openqa.selenium.WebDriver driver,
WebPage previous)
Calls
PageFactory.initElements(WebDriver, Object)
and waitUntilIsLoaded() . |
Modifier and Type | Method and Description |
---|---|
String |
getCurrentUrl() |
protected org.openqa.selenium.WebElement |
getElement(org.openqa.selenium.By locator) |
protected List<org.openqa.selenium.WebElement> |
getElements(org.openqa.selenium.By locator) |
protected org.openqa.selenium.By |
getIdentifyingLocator() |
String |
getTitle() |
protected void |
waitUntilIsLoaded()
Dumb wait until the HTML body element is visible.
|
protected static final org.apache.log4j.Logger logger
protected org.openqa.selenium.WebDriver driver
protected WebPage previousPage
public BaseWebPage(org.openqa.selenium.WebDriver driver, WebPage previous)
PageFactory.initElements(WebDriver, Object)
and waitUntilIsLoaded()
.driver
- previous
- public String getTitle()
public String getCurrentUrl()
getCurrentUrl
in interface WebPage
WebDriver.getCurrentUrl()
protected org.openqa.selenium.WebElement getElement(org.openqa.selenium.By locator)
locator
- WebElement
WebDriver.findElement(By)
protected List<org.openqa.selenium.WebElement> getElements(org.openqa.selenium.By locator)
locator
- WebElement
sWebDriver.findElements(By)
protected void waitUntilIsLoaded()
getIdentifyingLocator()
.protected org.openqa.selenium.By getIdentifyingLocator()
Copyright © 2015. All rights reserved.