public interface DroidDriver
Modifier and Type | Method and Description |
---|---|
void |
checkExists(Finder finder)
Polls until a
UiElement is found using the given finder, or the
default timeout is reached. |
void |
checkGone(Finder finder)
Polls until the
UiElement found using the given finder is gone, or
the default timeout is reached. |
boolean |
dumpUiElementTree(java.lang.String path)
Dumps the UiElement tree to a file to help debug.
|
UiElement |
find(Finder finder)
Returns the first
UiElement found using the given finder without
polling and without refreshUiElementTree() . |
Poller |
getPoller()
Returns the
Poller . |
UiDevice |
getUiDevice()
Returns a
UiDevice for device-wide interaction. |
boolean |
has(Finder finder)
Returns whether a matching element exists without polling.
|
boolean |
has(Finder finder,
long timeoutMillis)
Returns whether a matching element appears within
timeoutMillis . |
UiElement |
on(Finder finder)
Returns the first
UiElement found using the given finder. |
void |
refreshUiElementTree()
Refreshes the UiElement tree.
|
void |
setPoller(Poller poller)
Sets the
Poller . |
boolean has(Finder finder)
boolean has(Finder finder, long timeoutMillis)
timeoutMillis
.
Use this only if you have no way to determine the content of current page.
There are very few occasions using this is justified. For instance, you are
looking for UiElements in a scrollable view, whose content varies based on
the scroll position. Refrain from using this method in these cases:
UiElement el = driver.on(By.anyOf(finder1, finder2, ...)); // UI is stable now, find which one is returned if (finder1.matches(el)) ...
UiElement on(Finder finder)
UiElement
found using the given finder. This
method will poll until a match is found, or the default timeout is reached.finder
- The matching mechanismTimeoutException
- If no matching elements are found within the
allowed timeUiElement find(Finder finder)
UiElement
found using the given finder without
polling and without refreshUiElementTree()
. This method is useful in
Poller.PollingListener.onPolling(io.appium.droiddriver.DroidDriver, io.appium.droiddriver.finders.Finder)
. In other situations polling is
desired, and on(io.appium.droiddriver.finders.Finder)
is more appropriate.finder
- The matching mechanismElementNotFoundException
- If no matching elements are foundvoid refreshUiElementTree()
void checkExists(Finder finder)
UiElement
is found using the given finder, or the
default timeout is reached. This behaves the same as on(io.appium.droiddriver.finders.Finder)
except
that it does not return the UiElement
.finder
- The matching mechanismTimeoutException
- If matching element does not appear within the
default timeoutvoid checkGone(Finder finder)
UiElement
found using the given finder is gone, or
the default timeout is reached.finder
- The matching mechanismTimeoutException
- If matching element is not gone within the default
timeoutboolean dumpUiElementTree(java.lang.String path)
refreshUiElementTree()
is called.
The dump may contain invisible UiElements that are not used in the finding algorithm.
path
- the path of file to save the tree