public class UiObject extends Object implements UserinterfaceObject, MobileElement
UiObject
implements UserinterfaceObject
and forms the base class of all Android UI automation
elements.Modifier and Type | Field and Description |
---|---|
protected SeLionAndroidBridgeDriver |
driver |
protected String |
locator |
Modifier and Type | Method and Description |
---|---|
void |
clearText()
Clears the existing text contents in an editable field.
|
void |
click(Object... expected)
Performs a click at the center of the visible bounds of the UI element represented by this UiObject.
|
void |
clickBottomRight(Object... expected)
Clicks the bottom and right corner of the UI element.
|
void |
clickTopLeft(Object... expected)
Clicks the top and left corner of the UI element.
|
org.openqa.selenium.WebElement |
findElement(String locator)
Finds the corresponding web element using the string locator.
|
protected SeLionAndroidBridgeDriver |
getBridgeDriver() |
String |
getLocator()
Returns the locator.
|
String |
getText()
Reads the text property of the UI element.
|
String |
getValue()
Returns a string containing a value attribute specific to the type of element.
|
boolean |
isCheckable()
Checks if the UI element's checkable property is currently true.
|
boolean |
isChecked()
Checks if the UI element's checked property is currently true.
|
boolean |
isClickable()
Checks if the UI element's clickable property is currently true.
|
boolean |
isEnabled()
Checks if the UI element's enabled property is currently true.
|
boolean |
isFocusable()
Checks if the UI element's focusable property is currently true.
|
boolean |
isFocused()
Checks if the UI element's focused property is currently true.
|
boolean |
isLongClickable()
Checks if the view's long-clickable property is currently true.
|
boolean |
isScrollable()
Checks if the view's scrollable property is currently true.
|
boolean |
isSelected()
Checks if the UI element's selected property is currently true.
|
void |
longClick(Object... expected)
Long clicks the center of the visible bounds of the UI element.
|
void |
longClickBottomRight(Object... expected)
Long clicks bottom and right corner of the UI element.
|
void |
longClickTopLeft(Object... expected)
Long clicks on the top and left corner of the UI element.
|
void |
setText(String text)
Sets the text in an editable field, after clearing the field's content.
|
void |
swipeDown(Object... expected)
Performs the swipe down action on the UiObject.
|
void |
swipeLeft(Object... expected)
Performs the swipe left action on the UiObject.
|
void |
swipeRight(Object... expected)
Performs the swipe right action on the UiObject.
|
void |
swipeUp(Object... expected)
Performs the swipe up action on the UiObject.
|
void |
tap(Object... expected)
Taps the specified element and optionally waits for the provided expected elements.
|
protected void |
waitFor(Object... expected) |
protected String locator
protected SeLionAndroidBridgeDriver driver
public UiObject(String locator)
public void clearText()
UserinterfaceObject
clearText
in interface UserinterfaceObject
public void click(Object... expected)
UserinterfaceObject
click
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void clickBottomRight(Object... expected)
UserinterfaceObject
clickBottomRight
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void clickTopLeft(Object... expected)
UserinterfaceObject
clickTopLeft
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public String getText()
UserinterfaceObject
getText
in interface UserinterfaceObject
public boolean isCheckable()
UserinterfaceObject
isCheckable
in interface UserinterfaceObject
public boolean isChecked()
UserinterfaceObject
isChecked
in interface UserinterfaceObject
public boolean isClickable()
UserinterfaceObject
isClickable
in interface UserinterfaceObject
public boolean isEnabled()
UserinterfaceObject
isEnabled
in interface UserinterfaceObject
public boolean isFocusable()
UserinterfaceObject
isFocusable
in interface UserinterfaceObject
public boolean isFocused()
UserinterfaceObject
isFocused
in interface UserinterfaceObject
public boolean isLongClickable()
UserinterfaceObject
isLongClickable
in interface UserinterfaceObject
public boolean isScrollable()
UserinterfaceObject
isScrollable
in interface UserinterfaceObject
public boolean isSelected()
UserinterfaceObject
isSelected
in interface UserinterfaceObject
public void longClick(Object... expected)
UserinterfaceObject
longClick
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void longClickBottomRight(Object... expected)
UserinterfaceObject
longClickBottomRight
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void longClickTopLeft(Object... expected)
UserinterfaceObject
longClickTopLeft
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void setText(String text)
UserinterfaceObject
setText
in interface UserinterfaceObject
text
- String to set.public void swipeLeft(Object... expected)
UserinterfaceObject
swipeLeft
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void swipeRight(Object... expected)
UserinterfaceObject
swipeRight
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void swipeUp(Object... expected)
UserinterfaceObject
swipeUp
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public void swipeDown(Object... expected)
UserinterfaceObject
swipeDown
in interface UserinterfaceObject
expected
- Expected entities in the form of objects extending UiObject
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public org.openqa.selenium.WebElement findElement(String locator)
MobileElement
By
entity and fed to RemoteWebElement.findElement(By)
for further processing.findElement
in interface MobileElement
locator
- A String that represents the means to locate this element (could be id/name/xpath/css locator).WebElement
found by the locator.public void tap(Object... expected)
MobileElement
tap
in interface MobileElement
expected
- Expected entities in the form of objects extending UIAElement
, xpath location in the form of
String
, instances of ExpectedCondition
, or an instance of a WebPage
public String getValue()
MobileElement
getValue
in interface MobileElement
public String getLocator()
getLocator
in interface MobileElement
UiObject
protected void waitFor(Object... expected)
protected SeLionAndroidBridgeDriver getBridgeDriver()
Copyright © 2016 PayPal Open Source. All rights reserved.