Class MobileElement<T>
- java.lang.Object
-
- com.axway.ats.uiengine.elements.UiElement
-
- com.axway.ats.uiengine.elements.mobile.MobileElement<T>
-
- Direct Known Subclasses:
MobileButton,MobileLabel,MobileLink,MobileTextBox
public class MobileElement<T> extends UiElement
An Mobile element. Can be identified by:- id
- name
- text - the exact text that element displays
- partialText - some part of the text that element displays
- xpath
-
-
Field Summary
-
Fields inherited from class com.axway.ats.uiengine.elements.UiElement
log, properties
-
-
Constructor Summary
Constructors Constructor Description MobileElement(UiDriver uiDriver, UiElementProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tclick()Simulate tap/click actionbooleanclickIfExists(int waitingTimeout)Click/tap the element if exists.StringgetAttributeValue(String attribute)Get element attribute valueStringgetTextContent()Get innerText of the elementTscrollTo()Scroll to element (at the center of the screen)-
Methods inherited from class com.axway.ats.uiengine.elements.UiElement
checkTypeAndRules, getElementProperties, getElementProperty, getPropertyNamesToUseForMatch, getUiDriver, logAction, toString
-
-
-
-
Constructor Detail
-
MobileElement
public MobileElement(UiDriver uiDriver, UiElementProperties properties)
-
-
Method Detail
-
getAttributeValue
public String getAttributeValue(String attribute)
Get element attribute value- Returns:
- value of the attribute (style/class/...). Note: Currently for WebView elements seems to be returning something only if such HTML attribute is explicitly set.
-
getTextContent
public String getTextContent()
Get innerText of the element- Returns:
- innerText of the element
-
click
public T click()
Simulate tap/click action- Returns:
- this mobile element so allows chained actions like element.click().getTextContent()
-
clickIfExists
public boolean clickIfExists(int waitingTimeout)
Click/tap the element if exists.- Parameters:
waitingTimeout- timeout in milliseconds to wait for the element to appear
-
scrollTo
public T scrollTo()
Scroll to element (at the center of the screen)- Returns:
- this mobile element which allows chained actions
-
-