2 parent.title=uiautomator
6 h4.jd-details-title {background-color: #DEE8F1;}
10 <h2>Class Overview</h2>
11 <p>This class provides the mechanism for tests to describe the UI elements they
12 intend to target. A UI element has many properties associated with it such as
13 text value, content-description, class name and multiple state information like
14 selected, enabled, checked etc. Additionally UiSelector allows targeting of UI
15 elements within a specific display hierarchies to distinguish similar elements
16 based in the hierarchies they're in.</p>
22 </div><!-- jd-descr -->
39 <div class="jd-descr">
66 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
67 <table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr>
73 <td class="jd-typecol">
81 <td class="jd-linkcol" width="100%">
82 <span class="sympad"><a href="#UiSelector()">UiSelector</a></span>()
95 <!-- ========== METHOD SUMMARY =========== -->
96 <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
102 <td class="jd-typecol">
108 <a href="UiSelector.html">UiSelector</a>
110 <td class="jd-linkcol" width="100%">
111 <span class="sympad"><a href="#checked(boolean)">checked</a></span>(boolean val)
113 <div class="jd-descrdiv">Set the search criteria to match widgets that
114 are currently checked (usually for checkboxes).</div>
121 <td class="jd-typecol">
127 <a href="UiSelector.html">UiSelector</a>
129 <td class="jd-linkcol" width="100%">
130 <span class="sympad"><a href="#childSelector(com.android.uiautomator.core.UiSelector)">childSelector</a></span>(<a href="UiSelector.html">UiSelector</a> selector)
132 <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector.</div>
139 <td class="jd-typecol">
145 <a href="UiSelector.html">UiSelector</a>
147 <td class="jd-linkcol" width="100%">
148 <span class="sympad"><a href="#className(java.lang.String)">className</a></span>(String className)
150 <div class="jd-descrdiv">Set the search criteria to match the class property
151 for a widget (for example, "android.widget.Button").</div>
158 <td class="jd-typecol">
164 <a href="UiSelector.html">UiSelector</a>
166 <td class="jd-linkcol" width="100%">
167 <span class="sympad"><a href="#className(java.lang.Class<T>)">className</a></span>(Class<T> type)
169 <div class="jd-descrdiv">Set the search criteria to match the class property
170 for a widget (for example, "android.widget.Button").</div>
177 <td class="jd-typecol">
183 <a href="UiSelector.html">UiSelector</a>
185 <td class="jd-linkcol" width="100%">
186 <span class="sympad"><a href="#classNameMatches(java.lang.String)">classNameMatches</a></span>(String regex)
188 <div class="jd-descrdiv">Set the search criteria to match the class property
189 for a widget (for example, "android.widget.Button").</div>
196 <td class="jd-typecol">
202 <a href="UiSelector.html">UiSelector</a>
204 <td class="jd-linkcol" width="100%">
205 <span class="sympad"><a href="#clickable(boolean)">clickable</a></span>(boolean val)
207 <div class="jd-descrdiv">Set the search criteria to match widgets that are clickable.</div>
214 <td class="jd-typecol">
220 <a href="UiSelector.html">UiSelector</a>
222 <td class="jd-linkcol" width="100%">
223 <span class="sympad"><a href="#description(java.lang.String)">description</a></span>(String desc)
225 <div class="jd-descrdiv">Set the search criteria to match the content-description
226 property for a widget.</div>
233 <td class="jd-typecol">
239 <a href="UiSelector.html">UiSelector</a>
241 <td class="jd-linkcol" width="100%">
242 <span class="sympad"><a href="#descriptionContains(java.lang.String)">descriptionContains</a></span>(String desc)
244 <div class="jd-descrdiv">Set the search criteria to match the content-description
245 property for a widget.</div>
252 <td class="jd-typecol">
258 <a href="UiSelector.html">UiSelector</a>
260 <td class="jd-linkcol" width="100%">
261 <span class="sympad"><a href="#descriptionMatches(java.lang.String)">descriptionMatches</a></span>(String regex)
263 <div class="jd-descrdiv">Set the search criteria to match the content-description
264 property for a widget.</div>
271 <td class="jd-typecol">
277 <a href="UiSelector.html">UiSelector</a>
279 <td class="jd-linkcol" width="100%">
280 <span class="sympad"><a href="#descriptionStartsWith(java.lang.String)">descriptionStartsWith</a></span>(String desc)
282 <div class="jd-descrdiv">Set the search criteria to match the content-description
283 property for a widget.</div>
290 <td class="jd-typecol">
296 <a href="UiSelector.html">UiSelector</a>
298 <td class="jd-linkcol" width="100%">
299 <span class="sympad"><a href="#enabled(boolean)">enabled</a></span>(boolean val)
301 <div class="jd-descrdiv">Set the search criteria to match widgets that are enabled.</div>
308 <td class="jd-typecol">
314 <a href="UiSelector.html">UiSelector</a>
316 <td class="jd-linkcol" width="100%">
317 <span class="sympad"><a href="#focusable(boolean)">focusable</a></span>(boolean val)
319 <div class="jd-descrdiv">Set the search criteria to match widgets that are focusable.</div>
326 <td class="jd-typecol">
332 <a href="UiSelector.html">UiSelector</a>
334 <td class="jd-linkcol" width="100%">
335 <span class="sympad"><a href="#focused(boolean)">focused</a></span>(boolean val)
337 <div class="jd-descrdiv">Set the search criteria to match widgets that have focus.</div>
344 <td class="jd-typecol">
350 <a href="UiSelector.html">UiSelector</a>
352 <td class="jd-linkcol" width="100%">
353 <span class="sympad"><a href="#fromParent(com.android.uiautomator.core.UiSelector)">fromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector)
355 <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector which is used to
356 start search from the parent widget.</div>
363 <td class="jd-typecol">
369 <a href="UiSelector.html">UiSelector</a>
371 <td class="jd-linkcol" width="100%">
372 <span class="sympad"><a href="#index(int)">index</a></span>(int index)
374 <div class="jd-descrdiv">Set the search criteria to match the widget by its node
375 index in the layout hierarchy.</div>
382 <td class="jd-typecol">
388 <a href="UiSelector.html">UiSelector</a>
390 <td class="jd-linkcol" width="100%">
391 <span class="sympad"><a href="#instance(int)">instance</a></span>(int instance)
393 <div class="jd-descrdiv">Set the search criteria to match the
394 widget by its instance number.</div>
401 <td class="jd-typecol">
407 <a href="UiSelector.html">UiSelector</a>
409 <td class="jd-linkcol" width="100%">
410 <span class="sympad"><a href="#longClickable(boolean)">longClickable</a></span>(boolean val)
412 <div class="jd-descrdiv">Set the search criteria to match widgets that are long-clickable.</div>
419 <td class="jd-typecol">
425 <a href="UiSelector.html">UiSelector</a>
427 <td class="jd-linkcol" width="100%">
428 <span class="sympad"><a href="#packageName(java.lang.String)">packageName</a></span>(String name)
430 <div class="jd-descrdiv">Set the search criteria to match the package name
431 of the application that contains the widget.</div>
438 <td class="jd-typecol">
444 <a href="UiSelector.html">UiSelector</a>
446 <td class="jd-linkcol" width="100%">
447 <span class="sympad"><a href="#packageNameMatches(java.lang.String)">packageNameMatches</a></span>(String regex)
449 <div class="jd-descrdiv">Set the search criteria to match the package name
450 of the application that contains the widget.</div>
457 <td class="jd-typecol">
463 <a href="UiSelector.html">UiSelector</a>
465 <td class="jd-linkcol" width="100%">
466 <span class="sympad"><a href="#scrollable(boolean)">scrollable</a></span>(boolean val)
468 <div class="jd-descrdiv">Set the search criteria to match widgets that are scrollable.</div>
475 <td class="jd-typecol">
481 <a href="UiSelector.html">UiSelector</a>
483 <td class="jd-linkcol" width="100%">
484 <span class="sympad"><a href="#selected(boolean)">selected</a></span>(boolean val)
486 <div class="jd-descrdiv">Set the search criteria to match widgets that
487 are currently selected.</div>
494 <td class="jd-typecol">
500 <a href="UiSelector.html">UiSelector</a>
502 <td class="jd-linkcol" width="100%">
503 <span class="sympad"><a href="#text(java.lang.String)">text</a></span>(String text)
505 <div class="jd-descrdiv">Set the search criteria to match the visible text displayed
506 for a widget (for example, the text label to launch an app).</div>
513 <td class="jd-typecol">
519 <a href="UiSelector.html">UiSelector</a>
521 <td class="jd-linkcol" width="100%">
522 <span class="sympad"><a href="#textContains(java.lang.String)">textContains</a></span>(String text)
524 <div class="jd-descrdiv">Set the search criteria to match the visible text displayed
525 for a widget (for example, the text label to launch an app).</div>
532 <td class="jd-typecol">
538 <a href="UiSelector.html">UiSelector</a>
540 <td class="jd-linkcol" width="100%">
541 <span class="sympad"><a href="#textMatches(java.lang.String)">textMatches</a></span>(String regex)
543 <div class="jd-descrdiv">Set the search criteria to match the visible text displayed
544 for a widget (for example, the text label to launch an app).</div>
551 <td class="jd-typecol">
557 <a href="UiSelector.html">UiSelector</a>
559 <td class="jd-linkcol" width="100%">
560 <span class="sympad"><a href="#textStartsWith(java.lang.String)">textStartsWith</a></span>(String text)
562 <div class="jd-descrdiv">Text property is usually the widget's visible text on the display.</div>
569 <td class="jd-typecol">
577 <td class="jd-linkcol" width="100%">
578 <span class="sympad"><a href="#toString()">toString</a></span>()
592 <!-- ========== METHOD SUMMARY =========== -->
593 <table id="inhmethods" class="jd-sumtable"><tr><th>
594 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
595 <div style="clear:left;">Inherited Methods</div></th></tr>
598 <tr class="api apilevel-" >
600 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
601 ><img id="inherited-methods-java.lang.Object-trigger"
602 src="../../../../../assets/images/triangle-closed.png"
603 class="jd-expando-trigger-img" /></a>
608 <div id="inherited-methods-java.lang.Object">
609 <div id="inherited-methods-java.lang.Object-list"
610 class="jd-inheritedlinks">
612 <div id="inherited-methods-java.lang.Object-summary" style="display: none;">
613 <table class="jd-sumtable-expando">
619 <td class="jd-typecol">
627 <td class="jd-linkcol" width="100%">
628 <span class="sympad">equals</span>(Object arg0)
635 <td class="jd-typecol">
643 <td class="jd-linkcol" width="100%">
644 <span class="sympad">getClass</span>()
651 <td class="jd-typecol">
659 <td class="jd-linkcol" width="100%">
660 <span class="sympad">hashCode</span>()
667 <td class="jd-typecol">
675 <td class="jd-linkcol" width="100%">
676 <span class="sympad">notify</span>()
683 <td class="jd-typecol">
691 <td class="jd-linkcol" width="100%">
692 <span class="sympad">notifyAll</span>()
699 <td class="jd-typecol">
707 <td class="jd-linkcol" width="100%">
708 <span class="sympad">toString</span>()
715 <td class="jd-typecol">
723 <td class="jd-linkcol" width="100%">
724 <span class="sympad">wait</span>()
731 <td class="jd-typecol">
739 <td class="jd-linkcol" width="100%">
740 <span class="sympad">wait</span>(long arg0, int arg1)
747 <td class="jd-typecol">
755 <td class="jd-linkcol" width="100%">
756 <span class="sympad">wait</span>(long arg0)
770 </div><!-- jd-descr (summary) -->
781 <!-- XML Attributes -->
793 <!-- Public ctors -->
796 <!-- ========= CONSTRUCTOR DETAIL ======== -->
797 <h2>Public Constructors</h2>
801 <a id="UiSelector()"></a>
803 <div class="jd-details api ">
804 <h4 class="jd-details-title">
805 <span class="normal">
813 <span class="sympad">UiSelector</span>
814 <span class="normal">()</span>
816 <div class="api-level">
824 <div class="jd-details-descr">
826 <div class="jd-tagdata jd-tagdescr"><p></p></div>
835 <!-- ========= CONSTRUCTOR DETAIL ======== -->
836 <!-- Protected ctors -->
840 <!-- ========= METHOD DETAIL ======== -->
841 <!-- Public methdos -->
843 <h2>Public Methods</h2>
847 <a id="checked(boolean)"></a>
849 <div class="jd-details api ">
850 <h4 class="jd-details-title">
851 <span class="normal">
857 <a href="UiSelector.html">UiSelector</a>
859 <span class="sympad">checked</span>
860 <span class="normal">(boolean val)</span>
862 <div class="api-level">
870 <div class="jd-details-descr">
872 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that
873 are currently checked (usually for checkboxes).
875 Typically, using this search criteria alone is not useful.
876 You should also include additional criteria, such as text,
877 content-description, or the class name for a widget.
879 If no other search criteria is specified, and there is more
880 than one matching widget, the first widget in the tree
881 is selected.</p></div>
882 <div class="jd-tagdata">
883 <h5 class="jd-tagtitle">Parameters</h5>
884 <table class="jd-tagtable">
887 <td>Value to match</td>
891 <div class="jd-tagdata">
892 <h5 class="jd-tagtitle">Returns</h5>
893 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
900 <a id="childSelector(com.android.uiautomator.core.UiSelector)"></a>
902 <div class="jd-details api ">
903 <h4 class="jd-details-title">
904 <span class="normal">
910 <a href="UiSelector.html">UiSelector</a>
912 <span class="sympad">childSelector</span>
913 <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span>
915 <div class="api-level">
923 <div class="jd-details-descr">
925 <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector.
927 Use this selector to narrow the search scope to
928 child widgets under a specific parent widget.</p></div>
929 <div class="jd-tagdata">
930 <h5 class="jd-tagtitle">Returns</h5>
931 <ul class="nolist"><li>UiSelector with this added search criterion</li></ul>
938 <a id="className(java.lang.String)"></a>
940 <div class="jd-details api ">
941 <h4 class="jd-details-title">
942 <span class="normal">
948 <a href="UiSelector.html">UiSelector</a>
950 <span class="sympad">className</span>
951 <span class="normal">(String className)</span>
953 <div class="api-level">
961 <div class="jd-details-descr">
963 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property
964 for a widget (for example, "android.widget.Button").</p></div>
965 <div class="jd-tagdata">
966 <h5 class="jd-tagtitle">Parameters</h5>
967 <table class="jd-tagtable">
970 <td>Value to match</td>
974 <div class="jd-tagdata">
975 <h5 class="jd-tagtitle">Returns</h5>
976 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
983 <a id="className(java.lang.Class<T>)"></a>
985 <div class="jd-details api ">
986 <h4 class="jd-details-title">
987 <span class="normal">
993 <a href="UiSelector.html">UiSelector</a>
995 <span class="sympad">className</span>
996 <span class="normal">(Class<T> type)</span>
998 <div class="api-level">
1006 <div class="jd-details-descr">
1008 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property
1009 for a widget (for example, "android.widget.Button").</p></div>
1010 <div class="jd-tagdata">
1011 <h5 class="jd-tagtitle">Returns</h5>
1012 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1014 <div class="jd-tagdata">
1015 <h5 class="jd-tagtitle">Since</h5>
1016 <ul class="nolist"><li>Android API Level 17</li></ul>
1022 <a id="classNameMatches(java.lang.String)"></a>
1024 <div class="jd-details api ">
1025 <h4 class="jd-details-title">
1026 <span class="normal">
1032 <a href="UiSelector.html">UiSelector</a>
1034 <span class="sympad">classNameMatches</span>
1035 <span class="normal">(String regex)</span>
1037 <div class="api-level">
1045 <div class="jd-details-descr">
1047 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property
1048 for a widget (for example, "android.widget.Button").</p></div>
1049 <div class="jd-tagdata">
1050 <h5 class="jd-tagtitle">Returns</h5>
1051 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1053 <div class="jd-tagdata">
1054 <h5 class="jd-tagtitle">Since</h5>
1055 <ul class="nolist"><li>Android API Level 17</li></ul>
1061 <a id="clickable(boolean)"></a>
1063 <div class="jd-details api ">
1064 <h4 class="jd-details-title">
1065 <span class="normal">
1071 <a href="UiSelector.html">UiSelector</a>
1073 <span class="sympad">clickable</span>
1074 <span class="normal">(boolean val)</span>
1076 <div class="api-level">
1084 <div class="jd-details-descr">
1086 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are clickable.
1088 Typically, using this search criteria alone is not useful.
1089 You should also include additional criteria, such as text,
1090 content-description, or the class name for a widget.
1092 If no other search criteria is specified, and there is more
1093 than one matching widget, the first widget in the tree
1094 is selected.</p></div>
1095 <div class="jd-tagdata">
1096 <h5 class="jd-tagtitle">Parameters</h5>
1097 <table class="jd-tagtable">
1100 <td>Value to match</td>
1104 <div class="jd-tagdata">
1105 <h5 class="jd-tagtitle">Returns</h5>
1106 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1113 <a id="description(java.lang.String)"></a>
1115 <div class="jd-details api ">
1116 <h4 class="jd-details-title">
1117 <span class="normal">
1123 <a href="UiSelector.html">UiSelector</a>
1125 <span class="sympad">description</span>
1126 <span class="normal">(String desc)</span>
1128 <div class="api-level">
1136 <div class="jd-details-descr">
1138 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description
1139 property for a widget.
1141 The content-description is typically used
1142 by the Android Accessibility framework to
1143 provide an audio prompt for the widget when
1144 the widget is selected. The content-description
1145 for the widget must match exactly
1146 with the string in your input argument.
1148 Matching is case-sensitive.</p></div>
1149 <div class="jd-tagdata">
1150 <h5 class="jd-tagtitle">Parameters</h5>
1151 <table class="jd-tagtable">
1154 <td>Value to match</td>
1158 <div class="jd-tagdata">
1159 <h5 class="jd-tagtitle">Returns</h5>
1160 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1167 <a id="descriptionContains(java.lang.String)"></a>
1169 <div class="jd-details api ">
1170 <h4 class="jd-details-title">
1171 <span class="normal">
1177 <a href="UiSelector.html">UiSelector</a>
1179 <span class="sympad">descriptionContains</span>
1180 <span class="normal">(String desc)</span>
1182 <div class="api-level">
1190 <div class="jd-details-descr">
1192 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description
1193 property for a widget.
1195 The content-description is typically used
1196 by the Android Accessibility framework to
1197 provide an audio prompt for the widget when
1198 the widget is selected. The content-description
1199 for the widget must contain
1200 the string in your input argument.
1202 Matching is case-insensitive.</p></div>
1203 <div class="jd-tagdata">
1204 <h5 class="jd-tagtitle">Parameters</h5>
1205 <table class="jd-tagtable">
1208 <td>Value to match</td>
1212 <div class="jd-tagdata">
1213 <h5 class="jd-tagtitle">Returns</h5>
1214 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1221 <a id="descriptionMatches(java.lang.String)"></a>
1223 <div class="jd-details api ">
1224 <h4 class="jd-details-title">
1225 <span class="normal">
1231 <a href="UiSelector.html">UiSelector</a>
1233 <span class="sympad">descriptionMatches</span>
1234 <span class="normal">(String regex)</span>
1236 <div class="api-level">
1244 <div class="jd-details-descr">
1246 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description
1247 property for a widget.
1249 The content-description is typically used
1250 by the Android Accessibility framework to
1251 provide an audio prompt for the widget when
1252 the widget is selected. The content-description
1253 for the widget must match exactly
1254 with the string in your input argument.</p></div>
1255 <div class="jd-tagdata">
1256 <h5 class="jd-tagtitle">Returns</h5>
1257 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1259 <div class="jd-tagdata">
1260 <h5 class="jd-tagtitle">Since</h5>
1261 <ul class="nolist"><li>Android API Level 17</li></ul>
1267 <a id="descriptionStartsWith(java.lang.String)"></a>
1269 <div class="jd-details api ">
1270 <h4 class="jd-details-title">
1271 <span class="normal">
1277 <a href="UiSelector.html">UiSelector</a>
1279 <span class="sympad">descriptionStartsWith</span>
1280 <span class="normal">(String desc)</span>
1282 <div class="api-level">
1290 <div class="jd-details-descr">
1292 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description
1293 property for a widget.
1295 The content-description is typically used
1296 by the Android Accessibility framework to
1297 provide an audio prompt for the widget when
1298 the widget is selected. The content-description
1299 for the widget must start
1300 with the string in your input argument.
1302 Matching is case-insensitive.</p></div>
1303 <div class="jd-tagdata">
1304 <h5 class="jd-tagtitle">Parameters</h5>
1305 <table class="jd-tagtable">
1308 <td>Value to match</td>
1312 <div class="jd-tagdata">
1313 <h5 class="jd-tagtitle">Returns</h5>
1314 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1321 <a id="enabled(boolean)"></a>
1323 <div class="jd-details api ">
1324 <h4 class="jd-details-title">
1325 <span class="normal">
1331 <a href="UiSelector.html">UiSelector</a>
1333 <span class="sympad">enabled</span>
1334 <span class="normal">(boolean val)</span>
1336 <div class="api-level">
1344 <div class="jd-details-descr">
1346 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are enabled.
1348 Typically, using this search criteria alone is not useful.
1349 You should also include additional criteria, such as text,
1350 content-description, or the class name for a widget.
1352 If no other search criteria is specified, and there is more
1353 than one matching widget, the first widget in the tree
1354 is selected.</p></div>
1355 <div class="jd-tagdata">
1356 <h5 class="jd-tagtitle">Parameters</h5>
1357 <table class="jd-tagtable">
1360 <td>Value to match</td>
1364 <div class="jd-tagdata">
1365 <h5 class="jd-tagtitle">Returns</h5>
1366 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1373 <a id="focusable(boolean)"></a>
1375 <div class="jd-details api ">
1376 <h4 class="jd-details-title">
1377 <span class="normal">
1383 <a href="UiSelector.html">UiSelector</a>
1385 <span class="sympad">focusable</span>
1386 <span class="normal">(boolean val)</span>
1388 <div class="api-level">
1396 <div class="jd-details-descr">
1398 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are focusable.
1400 Typically, using this search criteria alone is not useful.
1401 You should also include additional criteria, such as text,
1402 content-description, or the class name for a widget.
1404 If no other search criteria is specified, and there is more
1405 than one matching widget, the first widget in the tree
1406 is selected.</p></div>
1407 <div class="jd-tagdata">
1408 <h5 class="jd-tagtitle">Parameters</h5>
1409 <table class="jd-tagtable">
1412 <td>Value to match</td>
1416 <div class="jd-tagdata">
1417 <h5 class="jd-tagtitle">Returns</h5>
1418 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1425 <a id="focused(boolean)"></a>
1427 <div class="jd-details api ">
1428 <h4 class="jd-details-title">
1429 <span class="normal">
1435 <a href="UiSelector.html">UiSelector</a>
1437 <span class="sympad">focused</span>
1438 <span class="normal">(boolean val)</span>
1440 <div class="api-level">
1448 <div class="jd-details-descr">
1450 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that have focus.
1452 Typically, using this search criteria alone is not useful.
1453 You should also include additional criteria, such as text,
1454 content-description, or the class name for a widget.
1456 If no other search criteria is specified, and there is more
1457 than one matching widget, the first widget in the tree
1458 is selected.</p></div>
1459 <div class="jd-tagdata">
1460 <h5 class="jd-tagtitle">Parameters</h5>
1461 <table class="jd-tagtable">
1464 <td>Value to match</td>
1468 <div class="jd-tagdata">
1469 <h5 class="jd-tagtitle">Returns</h5>
1470 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1477 <a id="fromParent(com.android.uiautomator.core.UiSelector)"></a>
1479 <div class="jd-details api ">
1480 <h4 class="jd-details-title">
1481 <span class="normal">
1487 <a href="UiSelector.html">UiSelector</a>
1489 <span class="sympad">fromParent</span>
1490 <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span>
1492 <div class="api-level">
1500 <div class="jd-details-descr">
1502 <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector which is used to
1503 start search from the parent widget.
1505 Use this selector to narrow the search scope to
1506 sibling widgets as well all child widgets under a parent.</p></div>
1507 <div class="jd-tagdata">
1508 <h5 class="jd-tagtitle">Returns</h5>
1509 <ul class="nolist"><li>UiSelector with this added search criterion</li></ul>
1516 <a id="index(int)"></a>
1518 <div class="jd-details api ">
1519 <h4 class="jd-details-title">
1520 <span class="normal">
1526 <a href="UiSelector.html">UiSelector</a>
1528 <span class="sympad">index</span>
1529 <span class="normal">(int index)</span>
1531 <div class="api-level">
1539 <div class="jd-details-descr">
1541 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the widget by its node
1542 index in the layout hierarchy.
1544 The index value must be 0 or greater.
1546 Using the index can be unreliable and should only
1547 be used as a last resort for matching. Instead,
1548 consider using the <code><a href="#instance(int)">instance(int)</a></code> method.</p></div>
1549 <div class="jd-tagdata">
1550 <h5 class="jd-tagtitle">Parameters</h5>
1551 <table class="jd-tagtable">
1554 <td>Value to match</td>
1558 <div class="jd-tagdata">
1559 <h5 class="jd-tagtitle">Returns</h5>
1560 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1567 <a id="instance(int)"></a>
1569 <div class="jd-details api ">
1570 <h4 class="jd-details-title">
1571 <span class="normal">
1577 <a href="UiSelector.html">UiSelector</a>
1579 <span class="sympad">instance</span>
1580 <span class="normal">(int instance)</span>
1582 <div class="api-level">
1590 <div class="jd-details-descr">
1592 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the
1593 widget by its instance number.
1595 The instance value must be 0 or greater, where
1596 the first instance is 0.
1598 For example, to simulate a user click on
1599 the third image that is enabled in a UI screen, you
1600 could specify a a search criteria where the instance is
1601 2, the <code><a href="#className(java.lang.String)">className(String)</a></code> matches the image
1602 widget class, and <code><a href="#enabled(boolean)">enabled(boolean)</a></code> is true.
1603 The code would look like this:
1605 new UiSelector().className("android.widget.ImageView")
1606 .enabled(true).instance(2);
1608 <div class="jd-tagdata">
1609 <h5 class="jd-tagtitle">Parameters</h5>
1610 <table class="jd-tagtable">
1613 <td>Value to match</td>
1617 <div class="jd-tagdata">
1618 <h5 class="jd-tagtitle">Returns</h5>
1619 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1626 <a id="longClickable(boolean)"></a>
1628 <div class="jd-details api ">
1629 <h4 class="jd-details-title">
1630 <span class="normal">
1636 <a href="UiSelector.html">UiSelector</a>
1638 <span class="sympad">longClickable</span>
1639 <span class="normal">(boolean val)</span>
1641 <div class="api-level">
1649 <div class="jd-details-descr">
1651 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are long-clickable.
1653 Typically, using this search criteria alone is not useful.
1654 You should also include additional criteria, such as text,
1655 content-description, or the class name for a widget.
1657 If no other search criteria is specified, and there is more
1658 than one matching widget, the first widget in the tree
1659 is selected.</p></div>
1660 <div class="jd-tagdata">
1661 <h5 class="jd-tagtitle">Parameters</h5>
1662 <table class="jd-tagtable">
1665 <td>Value to match</td>
1669 <div class="jd-tagdata">
1670 <h5 class="jd-tagtitle">Returns</h5>
1671 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1673 <div class="jd-tagdata">
1674 <h5 class="jd-tagtitle">Since</h5>
1675 <ul class="nolist"><li>Android API Level 17</li></ul>
1681 <a id="packageName(java.lang.String)"></a>
1683 <div class="jd-details api ">
1684 <h4 class="jd-details-title">
1685 <span class="normal">
1691 <a href="UiSelector.html">UiSelector</a>
1693 <span class="sympad">packageName</span>
1694 <span class="normal">(String name)</span>
1696 <div class="api-level">
1704 <div class="jd-details-descr">
1706 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name
1707 of the application that contains the widget.</p></div>
1708 <div class="jd-tagdata">
1709 <h5 class="jd-tagtitle">Parameters</h5>
1710 <table class="jd-tagtable">
1713 <td>Value to match</td>
1717 <div class="jd-tagdata">
1718 <h5 class="jd-tagtitle">Returns</h5>
1719 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1726 <a id="packageNameMatches(java.lang.String)"></a>
1728 <div class="jd-details api ">
1729 <h4 class="jd-details-title">
1730 <span class="normal">
1736 <a href="UiSelector.html">UiSelector</a>
1738 <span class="sympad">packageNameMatches</span>
1739 <span class="normal">(String regex)</span>
1741 <div class="api-level">
1749 <div class="jd-details-descr">
1751 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name
1752 of the application that contains the widget.</p></div>
1753 <div class="jd-tagdata">
1754 <h5 class="jd-tagtitle">Returns</h5>
1755 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1757 <div class="jd-tagdata">
1758 <h5 class="jd-tagtitle">Since</h5>
1759 <ul class="nolist"><li>Android API Level 17</li></ul>
1765 <a id="scrollable(boolean)"></a>
1767 <div class="jd-details api ">
1768 <h4 class="jd-details-title">
1769 <span class="normal">
1775 <a href="UiSelector.html">UiSelector</a>
1777 <span class="sympad">scrollable</span>
1778 <span class="normal">(boolean val)</span>
1780 <div class="api-level">
1788 <div class="jd-details-descr">
1790 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are scrollable.
1792 Typically, using this search criteria alone is not useful.
1793 You should also include additional criteria, such as text,
1794 content-description, or the class name for a widget.
1796 If no other search criteria is specified, and there is more
1797 than one matching widget, the first widget in the tree
1798 is selected.</p></div>
1799 <div class="jd-tagdata">
1800 <h5 class="jd-tagtitle">Parameters</h5>
1801 <table class="jd-tagtable">
1804 <td>Value to match</td>
1808 <div class="jd-tagdata">
1809 <h5 class="jd-tagtitle">Returns</h5>
1810 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1817 <a id="selected(boolean)"></a>
1819 <div class="jd-details api ">
1820 <h4 class="jd-details-title">
1821 <span class="normal">
1827 <a href="UiSelector.html">UiSelector</a>
1829 <span class="sympad">selected</span>
1830 <span class="normal">(boolean val)</span>
1832 <div class="api-level">
1840 <div class="jd-details-descr">
1842 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that
1843 are currently selected.
1845 Typically, using this search criteria alone is not useful.
1846 You should also include additional criteria, such as text,
1847 content-description, or the class name for a widget.
1849 If no other search criteria is specified, and there is more
1850 than one matching widget, the first widget in the tree
1851 is selected.</p></div>
1852 <div class="jd-tagdata">
1853 <h5 class="jd-tagtitle">Parameters</h5>
1854 <table class="jd-tagtable">
1857 <td>Value to match</td>
1861 <div class="jd-tagdata">
1862 <h5 class="jd-tagtitle">Returns</h5>
1863 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1870 <a id="text(java.lang.String)"></a>
1872 <div class="jd-details api ">
1873 <h4 class="jd-details-title">
1874 <span class="normal">
1880 <a href="UiSelector.html">UiSelector</a>
1882 <span class="sympad">text</span>
1883 <span class="normal">(String text)</span>
1885 <div class="api-level">
1893 <div class="jd-details-descr">
1895 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed
1896 for a widget (for example, the text label to launch an app).
1898 The text for the widget must match exactly
1899 with the string in your input argument.
1900 Matching is case-sensitive.</p></div>
1901 <div class="jd-tagdata">
1902 <h5 class="jd-tagtitle">Parameters</h5>
1903 <table class="jd-tagtable">
1906 <td>Value to match</td>
1910 <div class="jd-tagdata">
1911 <h5 class="jd-tagtitle">Returns</h5>
1912 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1919 <a id="textContains(java.lang.String)"></a>
1921 <div class="jd-details api ">
1922 <h4 class="jd-details-title">
1923 <span class="normal">
1929 <a href="UiSelector.html">UiSelector</a>
1931 <span class="sympad">textContains</span>
1932 <span class="normal">(String text)</span>
1934 <div class="api-level">
1942 <div class="jd-details-descr">
1944 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed
1945 for a widget (for example, the text label to launch an app).
1947 The text for the widget must contain the string in
1948 your input argument. Matching is case-sensitive.</p></div>
1949 <div class="jd-tagdata">
1950 <h5 class="jd-tagtitle">Parameters</h5>
1951 <table class="jd-tagtable">
1954 <td>Value to match</td>
1958 <div class="jd-tagdata">
1959 <h5 class="jd-tagtitle">Returns</h5>
1960 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
1967 <a id="textMatches(java.lang.String)"></a>
1969 <div class="jd-details api ">
1970 <h4 class="jd-details-title">
1971 <span class="normal">
1977 <a href="UiSelector.html">UiSelector</a>
1979 <span class="sympad">textMatches</span>
1980 <span class="normal">(String regex)</span>
1982 <div class="api-level">
1990 <div class="jd-details-descr">
1992 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed
1993 for a widget (for example, the text label to launch an app).
1995 The text for the widget must match exactly
1996 with the string in your input argument.</p></div>
1997 <div class="jd-tagdata">
1998 <h5 class="jd-tagtitle">Returns</h5>
1999 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul>
2001 <div class="jd-tagdata">
2002 <h5 class="jd-tagtitle">Since</h5>
2003 <ul class="nolist"><li>Android API Level 17</li></ul>
2009 <a id="textStartsWith(java.lang.String)"></a>
2011 <div class="jd-details api ">
2012 <h4 class="jd-details-title">
2013 <span class="normal">
2019 <a href="UiSelector.html">UiSelector</a>
2021 <span class="sympad">textStartsWith</span>
2022 <span class="normal">(String text)</span>
2024 <div class="api-level">
2032 <div class="jd-details-descr">
2034 <div class="jd-tagdata jd-tagdescr"><p>Text property is usually the widget's visible text on the display.
2036 Adding this to the search criteria indicates that the search performed
2037 should match a widget with text value starting with the text parameter.
2039 The matching will be case-insensitive.</p></div>
2040 <div class="jd-tagdata">
2041 <h5 class="jd-tagtitle">Returns</h5>
2042 <ul class="nolist"><li>UiSelector with this added search criterion</li></ul>
2049 <a id="toString()"></a>
2051 <div class="jd-details api ">
2052 <h4 class="jd-details-title">
2053 <span class="normal">
2061 <span class="sympad">toString</span>
2062 <span class="normal">()</span>
2064 <div class="api-level">
2072 <div class="jd-details-descr">
2074 <div class="jd-tagdata jd-tagdescr"><p></p></div>
2083 <!-- ========= METHOD DETAIL ======== -->
2087 <!-- ========= END OF CLASS DATA ========= -->