T - The page type.public class Page<T extends Page<T>> extends org.openqa.selenium.support.ui.LoadableComponent<T> implements WiseRoot<T>, org.openqa.selenium.internal.WrapsDriver
LoadableComponent, so you can easily take advantage of its loading resources
just by overriding the empty load() and isLoaded() methods. | Constructor and Description |
|---|
Page() |
Page(org.openqa.selenium.WebDriver driver) |
| Modifier and Type | Method and Description |
|---|---|
T |
and()
Returns this page instance in order to allow chain calls in a more fluent way.
|
Object |
executeScript(String script)
Executes a script on the page.
|
<E> E |
findElement(Class<E> clazz,
org.openqa.selenium.By by)
Finds the first element within the current context using the given mechanism.
|
<E> List<E> |
findElements(Class<E> clazz,
org.openqa.selenium.By by)
Finds all elements within the current context using the given mechanism.
|
T |
get(String url)
Loads a new web page in the current browser window using a HTTP GET operation.
|
String |
getCurrentUrl()
Retrieves the current URL that the browser is looking at.
|
String |
getPageSource()
Retrieves the source of the page rendered in the browser.
|
String |
getTitle()
Retrieves the title of the current page.
|
org.openqa.selenium.WebDriver |
getWrappedDriver() |
<E> E |
initNextPage(Class<E> clazz)
Instantiates the next page of the user navigation and initialize its elements.
|
protected void |
isLoaded() |
protected void |
load() |
T |
takeScreenShot(String fileName)
Takes a screenshot of the webDriver page and saves it into a file.
|
org.openqa.selenium.support.ui.WebDriverWait |
waitFor(long timeOutInSeconds)
A helper method for the
WebDriverWait.WebDriverWait(org.openqa.selenium.WebDriver, long). |
org.openqa.selenium.support.ui.WebDriverWait |
waitFor(long timeOutInSeconds,
long sleepInMillis)
A helper method for the
WebDriverWait.WebDriverWait(org.openqa.selenium.WebDriver, long, long). |
public Page()
public Page(org.openqa.selenium.WebDriver driver)
driver - The driver to be encapsulated within the page.public T and()
public Object executeScript(String script)
script - The script to be executed.public <E> E findElement(Class<E> clazz, org.openqa.selenium.By by)
WiseQueryfindElement in interface WiseQueryE - The type of the element.clazz - The class of the element. Must be either WebElement or a type annotated with
Field, Container or Frame. Will lookup for its implementation class following
ClasspathUtil.findImplementationClass(Class) rules.by - The locating mechanism to use.public <E> List<E> findElements(Class<E> clazz, org.openqa.selenium.By by)
WiseQueryfindElements in interface WiseQueryE - The type of the elements.clazz - The class of the elements. Must be either WebElement or a type annotated with
Field, Container or Frame. Will lookup for its implementation class following
ClasspathUtil.findImplementationClass(Class) rules.by - The locating mechanism to use.public T get(String url)
url - The URL to load. It is best to use a fully qualified URL.public String getCurrentUrl()
public String getPageSource()
public String getTitle()
public org.openqa.selenium.WebDriver getWrappedDriver()
getWrappedDriver in interface org.openqa.selenium.internal.WrapsDriverpublic <E> E initNextPage(Class<E> clazz)
E - The type of the page.clazz - The class of the page.public T takeScreenShot(String fileName)
ScreenShootingtakeScreenShot in interface ScreenShooting<T extends Page<T>>fileName - The name of the screenshot file.public org.openqa.selenium.support.ui.WebDriverWait waitFor(long timeOutInSeconds)
WiseRootWebDriverWait.WebDriverWait(org.openqa.selenium.WebDriver, long).public org.openqa.selenium.support.ui.WebDriverWait waitFor(long timeOutInSeconds,
long sleepInMillis)
WiseRootWebDriverWait.WebDriverWait(org.openqa.selenium.WebDriver, long, long).protected void isLoaded()
Copyright © 2013. All Rights Reserved.