Android Wireless test-uiautomator Uiwatcher API Introduction

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.