• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=UiWatcher
2parent.title=uiautomator
3parent.link=index.html
4@jd:body
5<style>
6    h4.jd-details-title {background-color: #DEE8F1;}
7</style>
8
9<p>Represents a conditional watcher on the target device. To learn how to register a conditional
10 watcher, see <code><a href="UiDevice.html#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">UiDevice.registerWatcher()</a></code>.
11</p>
12
13<div class="jd-descr">
14
15<h2>Summary</h2>
16
17<!-- ========== METHOD SUMMARY =========== -->
18<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
19
20
21
22
23    <tr class="api" >
24        <td class="jd-typecol">
25            abstract
26
27
28
29
30            boolean
31        </td>
32        <td class="jd-linkcol" width="100%">
33        <span class="sympad"><a href="#checkForCondition()">checkForCondition</a></span>()
34
35        <div class="jd-descrdiv">The testing framework calls this handler method automatically when the framework
36        is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>.</div>
37
38  </td></tr>
39
40</table>
41
42</div><!-- jd-descr (summary) -->
43
44
45<!-- ========= METHOD DETAIL ======== -->
46<!-- Public methdos -->
47
48<h2>Public Methods</h2>
49
50<a id="checkForCondition()"></a>
51
52<div class="jd-details api ">
53    <h4 class="jd-details-title">
54      <span class="normal">
55        public
56
57
58        abstract
59
60        boolean
61      </span>
62      <span class="sympad">checkForCondition</span>
63      <span class="normal">()</span>
64    </h4>
65      <div class="api-level">
66
67      </div>
68    <div class="jd-details-descr">
69
70  <div class="jd-tagdata jd-tagdescr"><p>The testing framework calls this handler method automatically when the framework is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>. 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.</p></div>
71  <div class="jd-tagdata">
72      <h5 class="jd-tagtitle">Returns</h5>
73      <ul class="nolist"><li>true to indicate a matched condition, or false if no matching condition is found
74</li></ul>
75  </div>
76
77    </div>
78</div>
79