public abstract class AbstractPageClass extends PageObjectUtils
Modifier and Type | Field and Description |
---|---|
protected File |
locatorFile |
browser, config
Constructor and Description |
---|
AbstractPageClass() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
at()
Method used to verify whether the driver object is on the said page or not.
|
File |
evaluateLocatorFile(String fileName) |
protected org.openqa.selenium.WebDriver |
getDriver()
Returns the driver object(if set) for this Page class else return the driver object from the
Browser class object. |
File |
getLocatorFile()
Return the locator file which have to be used for initializing the WebElements of the current Page class.
|
abstract void |
init()
Use this method in case you want to initialize some variables or data while creating an Object of you Page class.
|
void |
init(Browser browser)
Intialization method for the Page class
|
boolean |
isInitialized()
Return true or false based on the coniditon whether the said object has been
initialized by the TAF framework or its just an object.
|
protected void |
setDriver(org.openqa.selenium.WebDriver driver)
Sets the driver object for use with this page class.
|
void |
setLocatorFile(File file)
Sets the locator file which have to be used for initializing the WebElements of the current Page class.
|
abstract String |
toUrl()
The url for the said page.
|
at, at, at, at, at, at, getPageObject, getPageObject, getPageObject, getUrl, isAt, isAt, isAt, isAt, isAt, isAt, setBrowser, to, to, to, to, to, to, to
evaluateFileFromResourceDirectory, waitForElementPresent, waitForElementPresent, waitForElementPresent, waitForElementPresent, waitForElementToBeVisible, waitForElementToBeVisible, waitForPage, waitForPage
protected File locatorFile
public void init(Browser browser)
browser
- public boolean isInitialized()
protected void setDriver(org.openqa.selenium.WebDriver driver)
driver
- WebDriver
object to be set for use.protected org.openqa.selenium.WebDriver getDriver()
Browser
class object.public File getLocatorFile()
File
public void setLocatorFile(File file)
file
- public abstract String toUrl()
Note:Do not append the base url to this url as it is automatically appended at runtime.
public abstract boolean at()
This is a very important method as it will help in making you Page object model tests robust as it will help you to validate the Page is shown before any of the util methods of the said page is executed. Note: For better results do not store your evaluated condition in a variable. Try to evaluate the success condition everytime this method gets executed.
public abstract void init()
PageObjectUtils.to(Class)
or PageObjectUtils.at(Class)
utils.
In case you have nothing initialize just implement an empty method.Copyright © 2014. All rights reserved.