public interface TouchableElement<T extends WebElement> extends WebElement, FindsByClassName, FindsByCssSelector, FindsById, FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath
WebElement
and describes this behavior.Modifier and Type | Method and Description |
---|---|
T |
findElement(org.openqa.selenium.By by)
Find the first
WebElement using the given method. |
T |
findElementByClassName(String className) |
T |
findElementByCssSelector(String cssSelector) |
T |
findElementById(String id) |
T |
findElementByLinkText(String linkText) |
T |
findElementByName(String name) |
T |
findElementByPartialLinkText(String partialLinkText) |
T |
findElementByTagName(String tagName) |
T |
findElementByXPath(String xPath) |
List<T> |
findElements(org.openqa.selenium.By by)
Find all elements within the current context using the given mechanism.
|
List<T> |
findElementsByClassName(String className) |
List<T> |
findElementsByCssSelector(String cssSelector) |
List<T> |
findElementsById(String id) |
List<T> |
findElementsByLinkText(String linkText) |
List<T> |
findElementsByName(String name) |
List<T> |
findElementsByPartialLinkText(String partialLinkText) |
List<T> |
findElementsByTagName(String tagName) |
List<T> |
findElementsByXPath(String xPath) |
void |
pinch()
Convenience method for pinching the given element.
|
void |
swipe(SwipeElementDirection direction,
int duration)
Convenience method for swiping on the given element to the given direction.
|
void |
swipe(SwipeElementDirection direction,
int offsetFromStartBorder,
int offsetFromEndBorder,
int duration)
Convenience method for swiping on the given element to the given direction.
|
void |
tap(int fingers,
int duration)
Convenience method for tapping the center of the given element.
|
void |
zoom()
Convenience method for "zooming in" on the given element.
|
clear, click, getAttribute, getCssValue, getLocation, getRect, getSize, getTagName, getText, isDisplayed, isEnabled, isSelected, sendKeys, submit
List<T> findElements(org.openqa.selenium.By by)
WebElement
findElements
in interface SearchContext
findElements
in interface WebElement
by
- The locating mechanism to useWebElement
s, or an empty list if nothing matches.By
,
WebDriver.Timeouts
T findElement(org.openqa.selenium.By by)
WebElement
WebElement
using the given method. See the note in
WebElement.findElements(By)
about finding via XPath.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.
findElement should not be used to look for non-present elements, use WebElement.findElements(By)
and assert zero length response instead.
findElement
in interface SearchContext
findElement
in interface WebElement
by
- The locating mechanismBy
,
WebDriver.Timeouts
T findElementByClassName(String className)
findElementByClassName
in interface FindsByClassName
List<T> findElementsByClassName(String className)
findElementsByClassName
in interface FindsByClassName
T findElementByCssSelector(String cssSelector)
findElementByCssSelector
in interface FindsByCssSelector
List<T> findElementsByCssSelector(String cssSelector)
findElementsByCssSelector
in interface FindsByCssSelector
T findElementById(String id)
findElementById
in interface FindsById
List<T> findElementsById(String id)
findElementsById
in interface FindsById
T findElementByLinkText(String linkText)
findElementByLinkText
in interface FindsByLinkText
List<T> findElementsByLinkText(String linkText)
findElementsByLinkText
in interface FindsByLinkText
T findElementByPartialLinkText(String partialLinkText)
findElementByPartialLinkText
in interface FindsByLinkText
List<T> findElementsByPartialLinkText(String partialLinkText)
findElementsByPartialLinkText
in interface FindsByLinkText
T findElementByName(String name)
findElementByName
in interface FindsByName
List<T> findElementsByName(String name)
findElementsByName
in interface FindsByName
T findElementByTagName(String tagName)
findElementByTagName
in interface FindsByTagName
List<T> findElementsByTagName(String tagName)
findElementsByTagName
in interface FindsByTagName
T findElementByXPath(String xPath)
findElementByXPath
in interface FindsByXPath
List<T> findElementsByXPath(String xPath)
findElementsByXPath
in interface FindsByXPath
void pinch()
void tap(int fingers, int duration)
fingers
- number of fingers/appendages to tap with.duration
- how long between pressing down, and lifting fingers/appendages.void zoom()
void swipe(SwipeElementDirection direction, int duration)
direction
- UP, DOWN, LEFT, RIGHT.duration
- amount of time in milliseconds for the entire swipe action to
take.void swipe(SwipeElementDirection direction, int offsetFromStartBorder, int offsetFromEndBorder, int duration) throws IllegalCoordinatesException
direction
- direction UP, DOWN, LEFT, RIGHT.offsetFromStartBorder
- is the offset from the border of the element where the
swiping should be started. If direction is UP then
this is offset from the bottom of the element.
If direction is DOWN then this is offset from the top of
the element. If direction is RIGHT then this is offset from
the left border of the element. If direction is LEFT then
this is offset from the right border of the element.offsetFromEndBorder
- is the offset from the border of the element where
the swiping should be finished. If direction is UP then
this is offset from the top of the element.
If direction is DOWN then this is offset from the bottom
of the element. If direction is RIGHT then
this is offset from the right border of the element.
If direction is LEFT then this is offset from the
left border of the element.duration
- amount of time in milliseconds for the entire swipe action to
take.IllegalCoordinatesException
- when resulted coordinates are out of the
element borders or disagree with the given direction.Copyright © 2016. All rights reserved.