UiWatcher

Represents a conditional watcher on the target device. To learn how to register a conditional watcher, see UiDevice.registerWatcher().

Summary

Public Methods
abstract boolean checkForCondition()
The testing framework calls this handler method automatically when the framework is unable to find a match using the UiSelector.

Public Methods

public abstract boolean checkForCondition ()

The testing framework calls this handler method automatically when the framework is unable to find a match using the UiSelector. When a match is not found after a predetermined time has elapsed, the framework calls the checkForCondition() method of all registered watchers on the device. You can use this method to handle known blocking issues that are preventing the test from proceeding. For example, you can check if a dialog appeared that is blocking the the test, then close the dialog or perform some other appropriate action to allow the test to continue.

Returns
  • true to indicate a matched condition, or false if no matching condition is found