public abstract class PageObjectUtils extends Utilities
Modifier and Type | Field and Description |
---|---|
protected Browser |
browser |
protected DefaultConfig |
config |
Constructor and Description |
---|
PageObjectUtils() |
Modifier and Type | Method and Description |
---|---|
<T> T |
at(Class<?> pageClass)
Utility to verify that the driver is at said page or not.
|
<T> T |
at(Class<?> pageClass,
File file)
Utility to verify that the driver is at said page or not.
|
<T> T |
at(Class<?> pageClass,
String filePath)
Utility to verify that the driver is at said page or not.
|
<T> T |
at(T page)
Utility to verify that the driver is at said page or not.
|
<T> T |
at(T page,
File file)
Utility to verify that the driver is at said page or not.
|
<T> T |
at(T page,
String filePath)
Utility to verify that the driver is at said page or not.
|
<T> T |
getPageObject(Class<?> pageClass)
Utility to create and get the said page class object.
|
<T> T |
getPageObject(Class<?> pageClass,
File customLocatorFile)
Utility to create and get the said page class object.
|
<T> T |
getPageObject(Class<? extends PageClass> pageClass,
String filePath)
Utility to create and get the said page class object.
|
String |
getUrl(PageClass page) |
<T> boolean |
isAt(Class<?> pageClass)
Similar to
at(Class) method, instead it return true or false based on the at verification done. |
<T> boolean |
isAt(Class<?> pageClass,
File file)
Similar to
at(Class,java.io.File) method, instead it return true or false based on the at verification done. |
<T> boolean |
isAt(Class<?> pageClass,
String filePath)
Similar to
at(Class,java.lang.String) method, instead it return true or false based on the at verification done. |
<T> boolean |
isAt(T page)
Similar to
at(Class) method, instead it return true or false based on the at verification done. |
<T> boolean |
isAt(T page,
File file)
Similar to
#at(T,java.io.File) method, instead it return true or false based on the at verification done. |
<T> boolean |
isAt(T page,
String filePath)
Similar to
at(Class) method, instead it return true or false based on the at verification done. |
void |
setBrowser(Browser browser) |
<T> T |
to(Class<?> pageClass)
Navigates to said page after appending the base url to Page url.
|
<T> T |
to(Class<?> pageClass,
File file)
Navigates to said page after appending the base url to Page url and initializes any
PageFactory based WebElements in the said class using the provided locator file.
|
<T> T |
to(Class<?> pageClass,
String filePath)
Navigates to said page after appending the base url to Page url.
|
<T> T |
to(T page)
Navigates to said page after appending the base url to Page url.
|
<T> T |
to(T page,
File file)
Navigates to said page after appending the base url to Page url and initializes any
PageFactory based WebElements in the said class using the provided locator file.
|
<T> T |
to(T page,
String filePath)
Navigates to said page after appending the base url to Page url.
|
<T> T |
to(org.openqa.selenium.WebDriver driver,
T page) |
evaluateFileFromResourceDirectory, waitForElementPresent, waitForElementPresent, waitForElementPresent, waitForElementPresent, waitForElementToBeVisible, waitForElementToBeVisible, waitForPage, waitForPage
protected DefaultConfig config
protected Browser browser
public void setBrowser(Browser browser)
public <T> T getPageObject(Class<?> pageClass, File customLocatorFile)
This method initializes any PageFactory based WebElements present in the said class using the provided locator file.
pageClass
- Page class extending PageClass
for which the object has to be created and returned.customLocatorFile
- - File
object of the file containing the key/value pair of the locators.public <T> T getPageObject(Class<? extends PageClass> pageClass, String filePath)
This method initializes any PageFactory based WebElements present in the said class using the provided locator file path.
pageClass
- Page class extending PageClass
for which the object has to be created and returned.filePath
- - File path of the file containing the key/value pair of the locators.public <T> T getPageObject(Class<?> pageClass)
pageClass
- Page class extending PageClass
for which the object has to be created and returned.public <T> T to(org.openqa.selenium.WebDriver driver, T page)
public <T> T to(Class<?> pageClass)
pageClass
- - Page class extending PageClass
to where the driver have to be navigated.public <T> T at(Class<?> pageClass)
pageClass
- Page class extending PageClass
which have to verified to be on.public <T> T to(Class<?> pageClass, File file)
pageClass
- - Page class extending PageClass
to where the driver have to be navigated.file
- - File
object of the file containing the key/value pair of the locators.public <T> T to(Class<?> pageClass, String filePath)
pageClass
- - Page class extending PageClass
to where the driver have to be navigated.filePath
- - File path of the file containing the key/value pair of the locators.public <T> T at(Class<?> pageClass, String filePath)
pageClass
- Page class extending PageClass
which have to verified to be on.filePath
- - File path of the file containing the key/value pair of the locators.public <T> T at(Class<?> pageClass, File file)
pageClass
- Page class extending PageClass
which have to verified to be on.file
- - File
object of the file containing the key/value pair of the locators.public <T> T to(T page)
page
- - Object of the Page class extending PageClass
to where the driver have to be navigated.public <T> T at(T page)
page
- Object of the Page class extending PageClass
which have to verified to be on.public <T> T to(T page, File file)
page
- - Object of the Page class extending PageClass
to where the driver have to be navigated.file
- - File
object of the file containing the key/value pair of the locators.public <T> T to(T page, String filePath)
page
- - Object of the Page class extending PageClass
to where the driver have to be navigated.filePath
- - File path of the file containing the key/value pair of the locators.public <T> T at(T page, String filePath)
page
- Object of the Page class extending PageClass
which have to verified to be on.filePath
- - File path of the file containing the key/value pair of the locators.public <T> T at(T page, File file)
page
- Object of the Page class extending PageClass
which have to verified to be on.file
- - File
object of the file containing the key/value pair of the locators.public <T> boolean isAt(T page)
at(Class)
method, instead it return true or false based on the at verification done.page
- Object of the Page class extending PageClass
which have to verified to be on.public <T> boolean isAt(Class<?> pageClass, File file)
at(Class,java.io.File)
method, instead it return true or false based on the at verification done.
This method initializes any PageFactory based WebElements in the said
class using the provided locator file.pageClass
- Page class extending PageClass
which have to verified to be on.file
- - File
object of the file containing the key/value pair of the locators.public <T> boolean isAt(Class<?> pageClass, String filePath)
at(Class,java.lang.String)
method, instead it return true or false based on the at verification done.
This method initializes any PageFactory based WebElements present in the said
class using the provided locator file path.pageClass
- Page class extending PageClass
which have to verified to be on.filePath
- - File path of the file containing the key/value pair of the locators.public <T> boolean isAt(Class<?> pageClass)
at(Class)
method, instead it return true or false based on the at verification done.pageClass
- Page class extending PageClass
which have to verified to be on.public <T> boolean isAt(T page, File file)
#at(T,java.io.File)
method, instead it return true or false based on the at verification done.
This method initializes any PageFactory based WebElements in the said
class using the provided locator file.page
- Object of the Page class extending PageClass
which have to verified to be on.file
- - File
object of the file containing the key/value pair of the locators.public <T> boolean isAt(T page, String filePath)
at(Class)
method, instead it return true or false based on the at verification done.
This method initializes any PageFactory based WebElements present in the said
class using the provided locator file path.page
- Page class extending PageClass
which have to verified to be on.filePath
- - File path of the file containing the key/value pair of the locators.Copyright © 2014. All rights reserved.