|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.pageobjects.elements.WebDriverElement
public class WebDriverElement
Implementation of PageElement that waits for element to be
present before executing each actions.
| Field Summary | |
|---|---|
protected TimeoutType |
defaultTimeout
|
protected AtlassianWebDriver |
driver
|
protected WebDriverLocatable |
locatable
|
protected PageBinder |
pageBinder
|
protected Timeouts |
timeouts
|
| Constructor Summary | |
|---|---|
WebDriverElement(org.openqa.selenium.By locator)
Creates a WebDriverElement within the driver's search context and default timeout |
|
WebDriverElement(org.openqa.selenium.By locator,
TimeoutType timeoutType)
Creates a WebDriverElement within the driver's search context and given timeout type. |
|
WebDriverElement(org.openqa.selenium.By locator,
WebDriverLocatable parent)
Creates a WebDriverElement within a given parent and default timeout. |
|
WebDriverElement(org.openqa.selenium.By locator,
WebDriverLocatable parent,
TimeoutType timeoutType)
Creates a WebDriverElement within a given parent and given timeout type. |
|
WebDriverElement(WebDriverLocatable locatable,
TimeoutType timeoutType)
Creates a WebDriverElement with the given locatable and timeout type. |
|
| Method Summary | ||
|---|---|---|
org.openqa.selenium.WebElement |
asWebElement()
This allows retrieving the webelement from the page element. |
|
PageElement |
clear()
Clear the value of the text entry element. |
|
PageElement |
click()
Click this element |
|
protected WebDriverLocatable.LocateTimeout |
createTimout()
|
|
PageElement |
find(org.openqa.selenium.By locator)
Returns an element that will match the given locator within this element. |
|
|
find(org.openqa.selenium.By locator,
Class<T> elementClass)
Creates PageElement extension of type T using the specified
locator and default timeout. |
|
|
find(org.openqa.selenium.By locator,
Class<T> elementClass,
TimeoutType timeoutType)
Creates PageElement extension of type T using the specified
locator and given timeoutType |
|
PageElement |
find(org.openqa.selenium.By locator,
TimeoutType timeoutType)
Creates PageElement implementation
using the specified locator and given timeoutType. |
|
List<PageElement> |
findAll(org.openqa.selenium.By locator)
Returns a list of element's that match the given locator within this element |
|
|
findAll(org.openqa.selenium.By locator,
Class<T> elementClass)
Creates (@Link PageElement) extension of type T for each element that matches the given locator with default timeout |
|
|
findAll(org.openqa.selenium.By locator,
Class<T> elementClass,
TimeoutType timeoutType)
Creates (@Link PageElement) extension of type T for each element that matches the given locator with timeoutType |
|
List<PageElement> |
findAll(org.openqa.selenium.By locator,
TimeoutType timeoutType)
Creates a PageElement for each element that matches the given locator
using timeoutType. |
|
String |
getAttribute(String name)
Get the value of the given attribute of this element. |
|
org.openqa.selenium.Point |
getLocation()
Location of this element on the page (top-left corner) |
|
org.openqa.selenium.Dimension |
getSize()
Dimension of this element on the page |
|
String |
getTagName()
Get the tag name of this element |
|
String |
getText()
Get the visible innerText of this element, including sub-elements, without any leading or trailing whitespaces. |
|
String |
getValue()
Get the value of this element's "value" attribute. |
|
boolean |
hasAttribute(String name,
String value)
Whether this element has an attribute set to a specific value |
|
boolean |
hasClass(String className)
Whether this element has the given class set |
|
boolean |
isEnabled()
Whether this element is enabled on the page |
|
boolean |
isPresent()
Whether this element is currently on the DOM of the page |
|
boolean |
isSelected()
Whether this element is selected on the page. |
|
boolean |
isVisible()
Whether this element is visible on the page |
|
PageElementJavascript |
javascript()
Gets a PageElementJavascript for this element |
|
PageElement |
select()
Select an element. |
|
TimedElement |
timed()
Creates a timed element based on this element's locator. |
|
protected long |
timeout()
|
|
PageElement |
toggle()
If the element is a checkbox this will toggle the elements state from selected to not selected, or from not selected to selected. |
|
String |
toString()
|
|
PageElement |
type(CharSequence... keysToSend)
Simulate typing into this element. |
|
protected org.openqa.selenium.WebElement |
waitForWebElement()
|
|
PageElement |
withTimeout(TimeoutType timeoutType)
Returns an instance equivalent to this element, with a changed timeoutType. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
@Inject protected AtlassianWebDriver driver
@Inject protected PageBinder pageBinder
@Inject protected Timeouts timeouts
protected final WebDriverLocatable locatable
protected final TimeoutType defaultTimeout
| Constructor Detail |
|---|
public WebDriverElement(org.openqa.selenium.By locator)
locator - The locator mechanism to use.
public WebDriverElement(org.openqa.selenium.By locator,
TimeoutType timeoutType)
locator - The locator mechanism to use.timeoutType - default timeout of this element
public WebDriverElement(org.openqa.selenium.By locator,
WebDriverLocatable parent)
locator - The locator mechanism to use.parent - The locatable parent of this element.
public WebDriverElement(org.openqa.selenium.By locator,
WebDriverLocatable parent,
TimeoutType timeoutType)
locator - The locator mechanism to use.parent - The locatable parent of this element.timeoutType - default timeout of this element
public WebDriverElement(WebDriverLocatable locatable,
TimeoutType timeoutType)
locatable - WebDriverLocatable that that locate this elementtimeoutType - default timeout of this element| Method Detail |
|---|
protected long timeout()
protected WebDriverLocatable.LocateTimeout createTimout()
protected org.openqa.selenium.WebElement waitForWebElement()
public boolean isPresent()
PageElement
isPresent in interface PageElementpublic boolean isVisible()
PageElement
isVisible in interface PageElementpublic boolean isEnabled()
PageElement
isEnabled in interface PageElementpublic boolean isSelected()
PageElement
isSelected in interface PageElementpublic boolean hasClass(String className)
PageElement
hasClass in interface PageElementclassName - The name of the class to check
public String getAttribute(String name)
PageElement
getAttribute in interface PageElementname - The name of the attribute.
public boolean hasAttribute(String name,
String value)
PageElement
hasAttribute in interface PageElementname - The attribute namevalue - The expected value
public String getText()
PageElement
getText in interface PageElementpublic String getTagName()
PageElement
getTagName in interface PageElementpublic String getValue()
PageElement
getValue in interface PageElementpublic org.openqa.selenium.Point getLocation()
PageElement
getLocation in interface PageElementpublic org.openqa.selenium.Dimension getSize()
PageElement
getSize in interface PageElementpublic PageElement click()
PageElement
click in interface PageElementpublic PageElement type(CharSequence... keysToSend)
PageElement
type in interface PageElementkeysToSend - keys to type
public PageElement select()
PageElement
select in interface PageElementpublic PageElement toggle()
PageElement
toggle in interface PageElementpublic PageElement clear()
PageElement
clear in interface PageElementpublic TimedElement timed()
PageElement
timed in interface PageElementpublic PageElementJavascript javascript()
PageElement
javascript in interface PageElementpublic PageElement find(org.openqa.selenium.By locator)
PageElementPageElement.isPresent()
to check whether a corresponding element on the page actually exists.
find in interface PageElementfind in interface PageElementFinderlocator - The locator mechanism
public PageElement find(org.openqa.selenium.By locator,
TimeoutType timeoutType)
PageElementFinderPageElement implementation
using the specified locator and given timeoutType.
find in interface PageElementFinderlocator - Locator mechanism to usetimeoutType - timeout for the element's timed operations
public <T extends PageElement> T find(org.openqa.selenium.By locator,
Class<T> elementClass)
PageElementFinderPageElement extension of type T using the specified
locator and default timeout.
find in interface PageElementFinderlocator - Locator mechanism to useelementClass - The class of the element to create
public <T extends PageElement> T find(org.openqa.selenium.By locator,
Class<T> elementClass,
TimeoutType timeoutType)
PageElementFinderPageElement extension of type T using the specified
locator and given timeoutType
find in interface PageElementFinderlocator - Locator mechanism to useelementClass - The class of the element to createtimeoutType - timeout for the element's timed operations
public List<PageElement> findAll(org.openqa.selenium.By locator)
PageElement
findAll in interface PageElementfindAll in interface PageElementFinderlocator - The locator mecharnism
public List<PageElement> findAll(org.openqa.selenium.By locator,
TimeoutType timeoutType)
PageElementFinderPageElement for each element that matches the given locator
using timeoutType.
findAll in interface PageElementFinderlocator - Locator mechanism to usetimeoutType - timeout for the element's timed operations
public <T extends PageElement> List<T> findAll(org.openqa.selenium.By locator,
Class<T> elementClass)
PageElementFinder
findAll in interface PageElementFinderlocator - Locator mechanism to useelementClass - The class of the element to create
public <T extends PageElement> List<T> findAll(org.openqa.selenium.By locator,
Class<T> elementClass,
TimeoutType timeoutType)
PageElementFinder
findAll in interface PageElementFinderlocator - Locator mechanism to useelementClass - The class of the element to createtimeoutType - timeout for the element's timed operations
public org.openqa.selenium.WebElement asWebElement()
public PageElement withTimeout(TimeoutType timeoutType)
PageElement
withTimeout in interface PageElementtimeoutType - new timeout
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||