public class PollingListeners
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Poller.PollingListener |
newDismissListener(Finder watchFinder,
Finder dismissFinder)
Returns a new
PollingListener that will look for
watchFinder , then click dismissFinder to dismiss it. |
static boolean |
tryFindAndClick(DroidDriver driver,
Finder watchFinder)
Tries to find
watchFinder , and clicks it if found. |
public static boolean tryFindAndClick(DroidDriver driver, Finder watchFinder)
watchFinder
, and clicks it if found.driver
- a DroidDriver instancewatchFinder
- Identifies the UI component to watchwatchFinder
is foundpublic static Poller.PollingListener newDismissListener(Finder watchFinder, Finder dismissFinder)
PollingListener
that will look for
watchFinder
, then click dismissFinder
to dismiss it.
Typically a PollingListener
is used to dismiss "random" dialogs. If
you know the certain situation when a dialog is displayed, you should deal
with the dialog in the specific situation instead of using a
PollingListener
because it is checked in all polling events, which
occur frequently.
watchFinder
- Identifies the UI component, for example an AlertDialogdismissFinder
- Identifies the UiElement to click on that will dismiss
the UI component