public abstract class AbstractPage extends Object
Modifier and Type | Field and Description |
---|---|
protected org.openqa.selenium.WebDriver |
driver |
org.openqa.selenium.WebElement |
userServicesForm |
Constructor and Description |
---|
AbstractPage(org.openqa.selenium.WebDriver driver) |
Modifier and Type | Method and Description |
---|---|
<T> T |
asPage(Class<T> pageClassToProxy) |
protected void |
clickOnTabIfNotSelected(String tabPanelId,
String tabElementId) |
protected void |
clickOnTabIfNotSelected(String tabPanelId,
org.openqa.selenium.WebElement tabElement) |
protected void |
clickOnTabIfNotSelected(String tabPanelId,
org.openqa.selenium.WebElement tabElement,
boolean useAjax) |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout. |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a findElementTimeout . |
static List<org.openqa.selenium.WebElement> |
findElementsWithTimeout(org.openqa.selenium.By by)
Finds webelement list using the given method, with a timeout
|
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout. |
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a findElementTimeout . |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with a timeout. |
org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout)
Finds the first
WebElement using the given method, with a timeout. |
org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a timeout. |
<T> T |
get(String url,
Class<T> pageClassToProxy) |
String |
getErrorFeedbackMessage()
Returns the error feedback message.
|
org.openqa.selenium.WebElement |
getFancyBoxContent()
Returns the fancy box content web element
|
String |
getFeedbackMessage()
Deprecated.
since 5.8
|
HeaderLinksSubPage |
getHeaderLinks()
Gets the top bar navigation sub page.
|
<T extends WebFragment> |
getWebFragment(org.openqa.selenium.By by,
Class<T> webFragmentClass) |
<T extends WebFragment> |
getWebFragment(org.openqa.selenium.WebElement element,
Class<T> webFragmentClass) |
boolean |
hasElement(org.openqa.selenium.By by)
Returns true if corresponding element is found in the test page.
|
void |
selectItemInDropDownMenu(org.openqa.selenium.WebElement selector,
String optionLabel)
Selects item in drop down menu.
|
org.openqa.selenium.WebDriver |
switchToFrame(String id)
Switch to given frame id.
|
boolean |
useAjaxTabs()
Helper method to adapt tests behaviour when ajaxifying tabs.
|
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element)
Waits until an element is enabled, with a timeout.
|
void |
waitUntilURLDifferentFrom(String url)
Waits until the URL is different from the one given in parameter, with a timeout.
|
public org.openqa.selenium.WebElement userServicesForm
protected org.openqa.selenium.WebDriver driver
public AbstractPage(org.openqa.selenium.WebDriver driver)
public boolean hasElement(org.openqa.selenium.By by)
public <T extends WebFragment> T getWebFragment(org.openqa.selenium.By by, Class<T> webFragmentClass)
public <T extends WebFragment> T getWebFragment(org.openqa.selenium.WebElement element, Class<T> webFragmentClass)
@Deprecated public String getFeedbackMessage()
public String getErrorFeedbackMessage()
If there are more than one error message, always return the second one (not interested by 'Please correct errors' message).
public HeaderLinksSubPage getHeaderLinks()
public org.openqa.selenium.WebElement getFancyBoxContent()
public org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, int timeout) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsorg.openqa.selenium.NoSuchElementException
- when not foundpublic org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, int timeout, org.openqa.selenium.WebElement parentElement) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsparentElement
- find from the elementorg.openqa.selenium.NoSuchElementException
- when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsorg.openqa.selenium.NoSuchElementException
- when not foundpublic static List<org.openqa.selenium.WebElement> findElementsWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
org.openqa.selenium.NoSuchElementException
public static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, org.openqa.selenium.WebElement parentElement) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismparentElement
- find from the elementorg.openqa.selenium.NoSuchElementException
- when not foundpublic static void waitUntilEnabled(org.openqa.selenium.WebElement element) throws org.openqa.selenium.NotFoundException
element
- the elementorg.openqa.selenium.NotFoundException
public static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by, int findElementTimeout, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with a findElementTimeout
. Then waits until
the element is enabled, with a waitUntilEnabledTimeout
.by
- the locating mechanismfindElementTimeout
- the find element timeout in millisecondswaitUntilEnabledTimeout
- the wait until enabled timeout in millisecondsorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout. Then waits until the element
is enabled, with the default timeout.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by, int findElementTimeout, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with a findElementTimeout
. Then waits until
the element is enabled, with a waitUntilEnabledTimeout
. Then clicks on the element.by
- the locating mechanismfindElementTimeout
- the find element timeout in millisecondswaitUntilEnabledTimeout
- the wait until enabled timeout in millisecondsorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout. Then waits until the element
is enabled, with the default timeout. Then clicks on the element.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic void waitUntilURLDifferentFrom(String url)
url
- the URL to compare topublic void selectItemInDropDownMenu(org.openqa.selenium.WebElement selector, String optionLabel)
public org.openqa.selenium.WebDriver switchToFrame(String id)
public boolean useAjaxTabs()
protected void clickOnTabIfNotSelected(String tabPanelId, org.openqa.selenium.WebElement tabElement)
protected void clickOnTabIfNotSelected(String tabPanelId, org.openqa.selenium.WebElement tabElement, boolean useAjax)
protected void clickOnTabIfNotSelected(String tabPanelId, String tabElementId)
Copyright © 2015 Nuxeo SA. All rights reserved.