Package co.verisoft.fw.pages
Class BasePage
java.lang.Object
co.verisoft.fw.pages.BasePage
- Direct Known Subclasses:
MobileBasePage
,WebBasePage
Represent base page for WebDriver interface (Web, mobile, client - server)
This class contains the basic common functionality shared by all pages
- Author:
- David Yehezkel 30 Mar 2020
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.openqa.selenium.WebDriver
protected final int
protected ObjectRepository
protected final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
isOnPage()
Checks if driver is on pageboolean
isOnPage
(org.openqa.selenium.By locator) This is a another implementation of isOnPage.boolean
isOnPage
(org.openqa.selenium.WebElement... elements) This is a default implementation of isOnPage.boolean
urlContains
(String fraction) check if the main page url contains the text
-
Field Details
-
driver
protected org.openqa.selenium.WebDriver driver -
timeOut
protected final int timeOut -
pollingInterval
protected final int pollingInterval -
repository
-
-
Constructor Details
-
BasePage
public BasePage(org.openqa.selenium.WebDriver driver) C-tor. Initializes generic properties such as timeOut and pollingInterval- Parameters:
driver
- a WebDriver object to store and use
-
BasePage
C-tor. Initializes generic properties such as timeOut and pollingInterval- Parameters:
driver
- a WebDriver object to store and useobjectRepositoryFilePath
- a custom path to the object repository file
-
-
Method Details
-
isOnPage
public boolean isOnPage(org.openqa.selenium.WebElement... elements) This is a default implementation of isOnPage. It receives one or more WebElements and checks if they are present- Parameters:
elements
- One or more WebElements to check for presence- Returns:
- true- all elements specified were present, false - otherwise
-
isOnPage
public boolean isOnPage(org.openqa.selenium.By locator) This is a another implementation of isOnPage. It receives a locator and checks if all the WebElements located by this locator are present- Parameters:
locator
- By parameter to check for presence- Returns:
- true- all elements specified were present, false - otherwise
-
urlContains
check if the main page url contains the text- Parameters:
fraction
- part of url to be search for- Returns:
- true if text contains false otherwise
-
isOnPage
public abstract boolean isOnPage()Checks if driver is on page- Returns:
- true- all elements specified were present, false - otherwise
-