Uiwatcher class Introduction and interrupt monitoring check condition
I. Description of Uiwatcher class
1. Uiwatcher to handle unintended steps during script execution
2. Uiwatcher Use Scene
1) A call came in during the test.
2) A text message came in during the test.
3) The alarm clock is ringing during the test
4) There are a variety of non-expected steps
Second, interrupt monitoring check conditions
public boolean checkforcondition ();
Description
Using the Uiselector test framework will automatically call this handler method when the test framework cannot find a match. When a match is not found in the timeout, the framework calls the Checkforcondition () method to find all registered listening checks on the device. You can use this method to handle interrupt issues to ensure that the test case runs correctly .
Example:
If a dialog box appears, you can check the service information sent by the operator instead of the test exception.
Note:
In the actual work, we should think of all kinds of abnormal situations, write the corresponding listener, to deal with all kinds of abnormal situation
Android Wireless test-uiautomator Uiwatcher API Introduction