public abstract class BasePage extends Object
Modifier and Type | Field and Description |
---|---|
protected org.openqa.selenium.WebDriver |
driver |
protected WebUIDriver |
webUXDriver |
Constructor and Description |
---|
BasePage() |
Modifier and Type | Method and Description |
---|---|
void |
acceptAlert() |
void |
assertAlertPresent() |
void |
assertAlertText(String text) |
void |
assertAttribute(HtmlElement element,
String attributeName,
String value) |
void |
assertAttributeContains(HtmlElement element,
String attributeName,
String keyword) |
void |
assertAttributeMatches(HtmlElement element,
String attributeName,
String regex) |
void |
assertCondition(boolean condition,
String message) |
void |
assertConfirmationText(String text) |
protected void |
assertCurrentPage(boolean log) |
void |
assertElementDisplayed(HtmlElement element) |
void |
assertElementEnabled(HtmlElement element) |
void |
assertElementNotEnabled(HtmlElement element) |
void |
assertElementNotPresent(HtmlElement element) |
void |
assertElementNotSelected(HtmlElement element) |
void |
assertElementPresent(HtmlElement element) |
void |
assertElementSelected(HtmlElement element) |
void |
assertPromptText(String text) |
void |
assertTable(Table table,
int row,
int col,
String text) |
void |
assertTableContains(Table table,
int row,
int col,
String text) |
void |
assertTableMatches(Table table,
int row,
int col,
String text) |
void |
assertTextNotPresent(String text) |
void |
assertTextNotPresentIgnoreCase(String text) |
void |
assertTextPresent(String text) |
void |
assertTextPresentIgnoreCase(String text) |
String |
cancelConfirmation() |
protected abstract void |
capturePageSnapshot() |
BasePage |
closeOtherWindows(java.util.stream.Stream<String> windowStream,
String windowToRemainOpen)
Closes all windows except the one supplied
|
org.openqa.selenium.Alert |
getAlert() |
String |
getAlertText() |
String |
getConfirmation() |
org.openqa.selenium.WebDriver |
getDriver() |
String |
getPrompt() |
boolean |
isElementPresent(org.openqa.selenium.By by) |
boolean |
isFrame() |
static boolean |
isTextPresent(String text) |
void |
refreshPageTillTextAppears(String text,
int waitPeriodInSec) |
void |
selectFrame(org.openqa.selenium.By by) |
void |
selectWindow(String windowName)
If current window is closed then use driver.switchTo.window(handle).
|
static void |
switchToWindow(Set<String> allWindows,
String currentWindow) |
static void |
waitForElementChecked(HtmlElement element) |
static void |
waitForElementEditable(HtmlElement element) |
static void |
waitForElementPresent(org.openqa.selenium.By by) |
static void |
waitForElementPresent(org.openqa.selenium.By by,
int timeout) |
static void |
waitForElementPresent(HtmlElement element) |
static void |
waitForElementToBeVisible(HtmlElement element) |
static void |
waitForElementToDisappear(HtmlElement element) |
BasePage |
waitForGivenWindowCount(int windowCount,
int... waitPeriodInSec) |
protected void |
waitForSeconds(int seconds)
Wait For seconds.
|
static void |
waitForTextPresent(HtmlElement element,
String text) |
void |
waitForTextPresent(String text) |
void |
waitForTextToDisappear(String text) |
void |
waitForTextToDisappear(String text,
int explicitWaitTimeout) |
void |
waitForURLToBeginWith(String regex,
int waitCount) |
static void |
waitForURLToChange(String match,
int waitSeconds,
boolean partialMatch) |
protected org.openqa.selenium.WebDriver driver
protected final WebUIDriver webUXDriver
public void acceptAlert() throws NotCurrentPageException
NotCurrentPageException
public void assertAlertPresent()
public void assertAlertText(String text)
public void assertAttribute(HtmlElement element, String attributeName, String value)
element
- attributeName
- value
- public void assertAttributeContains(HtmlElement element, String attributeName, String keyword)
public void assertAttributeMatches(HtmlElement element, String attributeName, String regex)
public void assertConfirmationText(String text)
protected void assertCurrentPage(boolean log) throws NotCurrentPageException
NotCurrentPageException
public void assertElementNotPresent(HtmlElement element)
public void assertElementPresent(HtmlElement element)
public void assertElementEnabled(HtmlElement element)
public void assertElementNotEnabled(HtmlElement element)
public void assertElementDisplayed(HtmlElement element)
public void assertElementSelected(HtmlElement element)
public void assertElementNotSelected(HtmlElement element)
public void assertCondition(boolean condition, String message)
public void assertPromptText(String text)
public void assertTextNotPresent(String text)
public void assertTextNotPresentIgnoreCase(String text)
public void assertTextPresent(String text)
public void assertTextPresentIgnoreCase(String text)
public String cancelConfirmation() throws NotCurrentPageException
NotCurrentPageException
protected abstract void capturePageSnapshot()
public org.openqa.selenium.Alert getAlert()
public String getAlertText()
public String getConfirmation()
public org.openqa.selenium.WebDriver getDriver()
public String getPrompt()
public boolean isElementPresent(org.openqa.selenium.By by)
public boolean isFrame()
public static boolean isTextPresent(String text)
public void selectFrame(org.openqa.selenium.By by)
public final void selectWindow(String windowName) throws NotCurrentPageException
windowName
- NotCurrentPageException
public void refreshPageTillTextAppears(String text, int waitPeriodInSec) throws InterruptedException
InterruptedException
public static void waitForElementChecked(HtmlElement element)
public static void waitForElementEditable(HtmlElement element)
public static void waitForElementPresent(org.openqa.selenium.By by)
public static void waitForElementPresent(org.openqa.selenium.By by, int timeout)
public static void waitForElementPresent(HtmlElement element)
public static void waitForElementToBeVisible(HtmlElement element)
public static void waitForURLToChange(String match, int waitSeconds, boolean partialMatch)
public static void waitForElementToDisappear(HtmlElement element)
protected void waitForSeconds(int seconds)
seconds
- public static void waitForTextPresent(HtmlElement element, String text)
public void waitForTextPresent(String text)
public void waitForTextToDisappear(String text)
public void waitForTextToDisappear(String text, int explicitWaitTimeout)
public void waitForURLToBeginWith(String regex, int waitCount) throws InterruptedException
InterruptedException
public BasePage closeOtherWindows(java.util.stream.Stream<String> windowStream, String windowToRemainOpen)
windowStream
- windowToRemainOpen
- public BasePage waitForGivenWindowCount(int windowCount, int... waitPeriodInSec) throws InterruptedException
InterruptedException
Copyright © 2021. All rights reserved.