1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119<!DOCTYPE html> 120<html devsite> 121<head> 122 123 124 <meta name="top_category" value="develop" /> 125 126 <meta name="subcategory" value="reference" /> 127 128 129 <meta name="book_path" value="/reference/android/support/test/_book.yaml" /> 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145<title>UiCollection</title> 146 147 148</head> 149 150<body class="gc-documentation develop reference api apilevel-"> 151<div id="doc-api-level" class="" style="display:none"></div> 152 153 154 155 156<div id="naMessage"></div> 157 158<div id="api-info-block"> 159<div class="api-level"> 160 161 162 163 164</div> 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185<div class="sum-details-links"> 186 187Summary: 188 189 190 191 192 193 194 <a href="#inhconstants">Inherited Constants</a> 195 196 197 198 199 200 | <a href="#pubctors">Ctors</a> 201 202 203 204 205 | <a href="#pubmethods">Methods</a> 206 207 208 209 210 | <a href="#inhmethods">Inherited Methods</a> 211 212| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 213 214</div><!-- end sum-details-links --> 215</div><!-- end api-info-block --> 216 217<div class="api apilevel-" id="jd-content"> 218 219<!-- ======== START OF CLASS DATA ======== --> 220 221<h1 class="api-title">UiCollection</h1> 222<p> 223<code class="api-signature"> 224 public 225 226 227 228 class 229 UiCollection 230</code> 231<br> 232 233 234<code class="api-signature"> 235 236 237 238</code> 239 240<code class="api-signature"> 241 242 extends <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> 243 244 245 246</code> 247 248<code class="api-signature"> 249 250 251 252</code> 253 254</p><table class="jd-inheritance-table"> 255 256 257 <tr> 258 259 <td colspan="3" class="jd-inheritance-class-cell">java.lang.Object 260 </td> 261 </tr> 262 263 264 <tr> 265 266 <td class="jd-inheritance-space"> ↳</td> 267 268 <td colspan="2" class="jd-inheritance-class-cell"><a href="/reference/android/support/test/uiautomator/UiObject.html">android.support.test.uiautomator.UiObject</a> 269 </td> 270 </tr> 271 272 273 <tr> 274 275 <td class="jd-inheritance-space"> </td> 276 277 <td class="jd-inheritance-space"> ↳</td> 278 279 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.uiautomator.UiCollection 280 </td> 281 </tr> 282 283 284</table> 285 <table class="jd-sumtable jd-sumtable-subclasses"> 286 <tr><td style="border:none;margin:0;padding:0;"> 287 288 <a href="#" onclick="return toggleInherited(this, null)" id="subclasses-direct" class="jd-expando-trigger closed" 289 ><img height="34" id="subclasses-direct-trigger" 290 src="/assets/images/styles/disclosure_down.png" 291 class="jd-expando-trigger-img" /></a>Known Direct Subclasses 292 293 <div id="subclasses-direct"> 294 <div id="subclasses-direct-list" 295 class="jd-inheritedlinks" 296 297 > 298 299 300 <a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a> 301 302 303 </div> 304 <div id="subclasses-direct-summary" 305 style="display: none;" 306 > 307 308 <table class="jd-sumtable-expando"> 309 310 <tr class="alt-color api apilevel-" > 311 <td class="jd-linkcol"><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></td> 312 <td class="jd-descrcol" width="100%"> 313 UiScrollable is a <code><a href="/reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a></code> and provides support for searching 314 for items in scrollable layout elements. 315 316 317 318 </td> 319 </tr> 320 321 322 </table> 323 324 </div> 325 </div> 326 </td></tr> 327 </table> 328 329 330 331 332 333<br><hr> 334 335 336 <p>Used to enumerate a container's UI elements for the purpose of counting, 337 or targeting a sub elements by a child's text or description.</p> 338 339 340 341 342 343 344 345<h2 class="api-section">Summary</h2> 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362<!-- =========== ENUM CONSTANT SUMMARY =========== --> 363<table id="inhconstants" class="responsive constants inhtable"> 364<tr><th><h3>Inherited constants</h3></th></tr> 365 366 367 <tr class="api apilevel-" > 368 <td> 369 370 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-constants-android.support.test.uiautomator.UiObject" class="jd-expando-trigger closed" 371 ><img height="34" id="inherited-constants-android.support.test.uiautomator.UiObject-trigger" 372 src="/assets/images/styles/disclosure_down.png" 373 class="jd-expando-trigger-img" /></a>From 374 class 375 <code> 376 <a href="/reference/android/support/test/uiautomator/UiObject.html">android.support.test.uiautomator.UiObject</a> 377 </code> 378 <div id="inherited-constants-android.support.test.uiautomator.UiObject"> 379 <div id="inherited-constants-android.support.test.uiautomator.UiObject-list" 380 class="jd-inheritedlinks"> 381 </div> 382 <div id="inherited-constants-android.support.test.uiautomator.UiObject-summary" style="display: none;"> 383 <table class="jd-sumtable-expando responsive"> 384 385 386 387 <tr class="api apilevel-" > 388 <td><code>int</code></td> 389 <td width="100%"> 390 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#FINGER_TOUCH_HALF_WIDTH">FINGER_TOUCH_HALF_WIDTH</a></code> 391 <p> 392 393 394</p> 395 </td> 396 </tr> 397 398 399 <tr class="api apilevel-" > 400 <td><code>int</code></td> 401 <td width="100%"> 402 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#SWIPE_MARGIN_LIMIT">SWIPE_MARGIN_LIMIT</a></code> 403 <p> 404 405 406</p> 407 </td> 408 </tr> 409 410 411 <tr class="api apilevel-" > 412 <td><code>long</code></td> 413 <td width="100%"> 414 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_EVENT_TMEOUT">WAIT_FOR_EVENT_TMEOUT</a></code> 415 <p><em> 416 This constant is deprecated. 417 use <code><a href="/reference/android/support/test/uiautomator/Configurator.html#setScrollAcknowledgmentTimeout(long)">setScrollAcknowledgmentTimeout(long)</a></code> 418</em> 419 420 421</p> 422 </td> 423 </tr> 424 425 426 <tr class="api apilevel-" > 427 <td><code>long</code></td> 428 <td width="100%"> 429 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_SELECTOR_POLL">WAIT_FOR_SELECTOR_POLL</a></code> 430 <p> 431 432 433</p> 434 </td> 435 </tr> 436 437 438 <tr class="api apilevel-" > 439 <td><code>long</code></td> 440 <td width="100%"> 441 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_SELECTOR_TIMEOUT">WAIT_FOR_SELECTOR_TIMEOUT</a></code> 442 <p><em> 443 This constant is deprecated. 444 use <code><a href="/reference/android/support/test/uiautomator/Configurator.html#setWaitForSelectorTimeout(long)">setWaitForSelectorTimeout(long)</a></code> 445</em> 446 447 448</p> 449 </td> 450 </tr> 451 452 453 <tr class="api apilevel-" > 454 <td><code>long</code></td> 455 <td width="100%"> 456 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_WINDOW_TMEOUT">WAIT_FOR_WINDOW_TMEOUT</a></code> 457 <p> 458 459 460</p> 461 </td> 462 </tr> 463 464 465</table> 466 </div> 467 </div> 468 </td></tr> 469 470 471 472 473</table> 474 475 476 477 478 479 480 481 482 483<!-- ======== CONSTRUCTOR SUMMARY ======== --> 484<table id="pubctors" class="responsive constructors"> 485<tr><th colspan="2"><h3>Public constructors</h3></th></tr> 486 487 488 489 490 <tr class="api apilevel-" > 491 492 493 <td width="100%"> 494 <code> 495 <a href="/reference/android/support/test/uiautomator/UiCollection.html#UiCollection(android.support.test.uiautomator.UiSelector)">UiCollection</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 496 </code> 497 498 <p>Constructs an instance as described by the selector 499 500 501</p> 502 503 </td> 504 </tr> 505 506 507 508</table> 509 510 511 512 513 514 515<!-- ========== METHOD SUMMARY =========== --> 516<table id="pubmethods" class="responsive methods"> 517<tr><th colspan="2"><h3>Public methods</h3></th></tr> 518 519 520 521 522 <tr class="api apilevel-" > 523 524 525 <td><code> 526 527 528 529 530 531 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 532 </td> 533 534 <td width="100%"> 535 <code> 536 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByDescription</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text) 537 </code> 538 539 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 540 selector. 541 542 543</p> 544 545 </td> 546 </tr> 547 548 549 550 <tr class="api apilevel-" > 551 552 553 <td><code> 554 555 556 557 558 559 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 560 </td> 561 562 <td width="100%"> 563 <code> 564 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildByInstance(android.support.test.uiautomator.UiSelector, int)">getChildByInstance</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, int instance) 565 </code> 566 567 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 568 selector. 569 570 571</p> 572 573 </td> 574 </tr> 575 576 577 578 <tr class="api apilevel-" > 579 580 581 <td><code> 582 583 584 585 586 587 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 588 </td> 589 590 <td width="100%"> 591 <code> 592 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByText</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text) 593 </code> 594 595 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 596 selector. 597 598 599</p> 600 601 </td> 602 </tr> 603 604 605 606 <tr class="api apilevel-" > 607 608 609 <td><code> 610 611 612 613 614 615 int</code> 616 </td> 617 618 <td width="100%"> 619 <code> 620 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildCount(android.support.test.uiautomator.UiSelector)">getChildCount</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern) 621 </code> 622 623 <p>Counts child UI element instances matching the <code>childPattern</code> 624 argument. 625 626 627</p> 628 629 </td> 630 </tr> 631 632 633 634</table> 635 636 637 638 639 640 641 642<!-- ========== METHOD SUMMARY =========== --> 643<table id="inhmethods" class="methods inhtable"> 644<tr><th><h3>Inherited methods</h3></th></tr> 645 646 647<tr class="api apilevel-" > 648<td colspan="2"> 649 650 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.uiautomator.UiObject" class="jd-expando-trigger closed" 651 ><img height="34" id="inherited-methods-android.support.test.uiautomator.UiObject-trigger" 652 src="/assets/images/styles/disclosure_down.png" 653 class="jd-expando-trigger-img" /></a>From 654class 655<code> 656 657 <a href="/reference/android/support/test/uiautomator/UiObject.html">android.support.test.uiautomator.UiObject</a> 658 659</code> 660<div id="inherited-methods-android.support.test.uiautomator.UiObject"> 661 <div id="inherited-methods-android.support.test.uiautomator.UiObject-list" 662 class="jd-inheritedlinks"> 663 </div> 664 <div id="inherited-methods-android.support.test.uiautomator.UiObject-summary" style="display: none;"> 665 <table class="jd-sumtable-expando responsive"> 666 667 668 669 670 <tr class="api apilevel-" > 671 672 673 <td><code> 674 675 676 677 678 679 void</code> 680 </td> 681 682 <td width="100%"> 683 <code> 684 <a href="/reference/android/support/test/uiautomator/UiObject.html#clearTextField()">clearTextField</a>() 685 </code> 686 687 <p>Clears the existing text contents in an editable field. 688 689 690</p> 691 692 </td> 693 </tr> 694 695 696 697 <tr class="api apilevel-" > 698 699 700 <td><code> 701 702 703 704 705 706 boolean</code> 707 </td> 708 709 <td width="100%"> 710 <code> 711 <a href="/reference/android/support/test/uiautomator/UiObject.html#click()">click</a>() 712 </code> 713 714 <p>Performs a click at the center of the visible bounds of the UI element represented 715 by this UiObject. 716 717 718</p> 719 720 </td> 721 </tr> 722 723 724 725 <tr class="api apilevel-" > 726 727 728 <td><code> 729 730 731 732 733 734 boolean</code> 735 </td> 736 737 <td width="100%"> 738 <code> 739 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a>() 740 </code> 741 742 <p>Waits for window transitions that would typically take longer than the 743 usual default timeouts. 744 745 746</p> 747 748 </td> 749 </tr> 750 751 752 753 <tr class="api apilevel-" > 754 755 756 <td><code> 757 758 759 760 761 762 boolean</code> 763 </td> 764 765 <td width="100%"> 766 <code> 767 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a>(long timeout) 768 </code> 769 770 <p>Performs a click at the center of the visible bounds of the UI element represented 771 by this UiObject and waits for window transitions. 772 773 774</p> 775 776 </td> 777 </tr> 778 779 780 781 <tr class="api apilevel-" > 782 783 784 <td><code> 785 786 787 788 789 790 boolean</code> 791 </td> 792 793 <td width="100%"> 794 <code> 795 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickBottomRight()">clickBottomRight</a>() 796 </code> 797 798 <p>Clicks the bottom and right corner of the UI element 799 800 801</p> 802 803 </td> 804 </tr> 805 806 807 808 <tr class="api apilevel-" > 809 810 811 <td><code> 812 813 814 815 816 817 boolean</code> 818 </td> 819 820 <td width="100%"> 821 <code> 822 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickTopLeft()">clickTopLeft</a>() 823 </code> 824 825 <p>Clicks the top and left corner of the UI element 826 827 828</p> 829 830 </td> 831 </tr> 832 833 834 835 <tr class="api apilevel-" > 836 837 838 <td><code> 839 840 841 842 843 844 boolean</code> 845 </td> 846 847 <td width="100%"> 848 <code> 849 <a href="/reference/android/support/test/uiautomator/UiObject.html#dragTo(android.support.test.uiautomator.UiObject, int)">dragTo</a>(<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> destObj, int steps) 850 </code> 851 852 <p>Drags this object to a destination UiObject. 853 854 855</p> 856 857 </td> 858 </tr> 859 860 861 862 <tr class="api apilevel-" > 863 864 865 <td><code> 866 867 868 869 870 871 boolean</code> 872 </td> 873 874 <td width="100%"> 875 <code> 876 <a href="/reference/android/support/test/uiautomator/UiObject.html#dragTo(int, int, int)">dragTo</a>(int destX, int destY, int steps) 877 </code> 878 879 <p>Drags this object to arbitrary coordinates. 880 881 882</p> 883 884 </td> 885 </tr> 886 887 888 889 <tr class="api apilevel-" > 890 891 892 <td><code> 893 894 895 896 897 898 boolean</code> 899 </td> 900 901 <td width="100%"> 902 <code> 903 <a href="/reference/android/support/test/uiautomator/UiObject.html#exists()">exists</a>() 904 </code> 905 906 <p>Check if view exists. 907 908 909</p> 910 911 </td> 912 </tr> 913 914 915 916 <tr class="api apilevel-" > 917 918 919 <td><code> 920 921 922 923 924 925 AccessibilityNodeInfo</code> 926 </td> 927 928 <td width="100%"> 929 <code> 930 <a href="/reference/android/support/test/uiautomator/UiObject.html#findAccessibilityNodeInfo(long)">findAccessibilityNodeInfo</a>(long timeout) 931 </code> 932 933 <p>Finds a matching UI element in the accessibility hierarchy, by 934 using the selector for this UiObject. 935 936 937</p> 938 939 </td> 940 </tr> 941 942 943 944 <tr class="api apilevel-" > 945 946 947 <td><code> 948 949 950 951 952 953 Rect</code> 954 </td> 955 956 <td width="100%"> 957 <code> 958 <a href="/reference/android/support/test/uiautomator/UiObject.html#getBounds()">getBounds</a>() 959 </code> 960 961 <p>Returns the view's <code>bounds</code> property. 962 963 964</p> 965 966 </td> 967 </tr> 968 969 970 971 <tr class="api apilevel-" > 972 973 974 <td><code> 975 976 977 978 979 980 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 981 </td> 982 983 <td width="100%"> 984 <code> 985 <a href="/reference/android/support/test/uiautomator/UiObject.html#getChild(android.support.test.uiautomator.UiSelector)">getChild</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 986 </code> 987 988 <p>Creates a new UiObject for a child view that is under the present UiObject. 989 990 991</p> 992 993 </td> 994 </tr> 995 996 997 998 <tr class="api apilevel-" > 999 1000 1001 <td><code> 1002 1003 1004 1005 1006 1007 int</code> 1008 </td> 1009 1010 <td width="100%"> 1011 <code> 1012 <a href="/reference/android/support/test/uiautomator/UiObject.html#getChildCount()">getChildCount</a>() 1013 </code> 1014 1015 <p>Counts the child views immediately under the present UiObject. 1016 1017 1018</p> 1019 1020 </td> 1021 </tr> 1022 1023 1024 1025 <tr class="api apilevel-" > 1026 1027 1028 <td><code> 1029 1030 1031 1032 1033 1034 String</code> 1035 </td> 1036 1037 <td width="100%"> 1038 <code> 1039 <a href="/reference/android/support/test/uiautomator/UiObject.html#getClassName()">getClassName</a>() 1040 </code> 1041 1042 <p>Retrieves the <code>className</code> property of the UI element. 1043 1044 1045</p> 1046 1047 </td> 1048 </tr> 1049 1050 1051 1052 <tr class="api apilevel-" > 1053 1054 1055 <td><code> 1056 1057 1058 1059 1060 1061 String</code> 1062 </td> 1063 1064 <td width="100%"> 1065 <code> 1066 <a href="/reference/android/support/test/uiautomator/UiObject.html#getContentDescription()">getContentDescription</a>() 1067 </code> 1068 1069 <p>Reads the <code>content_desc</code> property of the UI element 1070 1071 1072</p> 1073 1074 </td> 1075 </tr> 1076 1077 1078 1079 <tr class="api apilevel-" > 1080 1081 1082 <td><code> 1083 1084 1085 1086 1087 1088 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 1089 </td> 1090 1091 <td width="100%"> 1092 <code> 1093 <a href="/reference/android/support/test/uiautomator/UiObject.html#getFromParent(android.support.test.uiautomator.UiSelector)">getFromParent</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 1094 </code> 1095 1096 <p>Creates a new UiObject for a sibling view or a child of the sibling view, 1097 relative to the present UiObject. 1098 1099 1100</p> 1101 1102 </td> 1103 </tr> 1104 1105 1106 1107 <tr class="api apilevel-" > 1108 1109 1110 <td><code> 1111 1112 1113 1114 1115 1116 String</code> 1117 </td> 1118 1119 <td width="100%"> 1120 <code> 1121 <a href="/reference/android/support/test/uiautomator/UiObject.html#getPackageName()">getPackageName</a>() 1122 </code> 1123 1124 <p>Reads the view's <code>package</code> property 1125 1126 1127</p> 1128 1129 </td> 1130 </tr> 1131 1132 1133 1134 <tr class="api apilevel-" > 1135 1136 1137 <td><code> 1138 1139 1140 1141 final 1142 1143 <a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 1144 </td> 1145 1146 <td width="100%"> 1147 <code> 1148 <a href="/reference/android/support/test/uiautomator/UiObject.html#getSelector()">getSelector</a>() 1149 </code> 1150 1151 <p>Debugging helper. 1152 1153 1154</p> 1155 1156 </td> 1157 </tr> 1158 1159 1160 1161 <tr class="api apilevel-" > 1162 1163 1164 <td><code> 1165 1166 1167 1168 1169 1170 String</code> 1171 </td> 1172 1173 <td width="100%"> 1174 <code> 1175 <a href="/reference/android/support/test/uiautomator/UiObject.html#getText()">getText</a>() 1176 </code> 1177 1178 <p>Reads the <code>text</code> property of the UI element 1179 1180 1181</p> 1182 1183 </td> 1184 </tr> 1185 1186 1187 1188 <tr class="api apilevel-" > 1189 1190 1191 <td><code> 1192 1193 1194 1195 1196 1197 Rect</code> 1198 </td> 1199 1200 <td width="100%"> 1201 <code> 1202 <a href="/reference/android/support/test/uiautomator/UiObject.html#getVisibleBounds()">getVisibleBounds</a>() 1203 </code> 1204 1205 <p>Returns the visible bounds of the view. 1206 1207 1208</p> 1209 1210 </td> 1211 </tr> 1212 1213 1214 1215 <tr class="api apilevel-" > 1216 1217 1218 <td><code> 1219 1220 1221 1222 1223 1224 boolean</code> 1225 </td> 1226 1227 <td width="100%"> 1228 <code> 1229 <a href="/reference/android/support/test/uiautomator/UiObject.html#isCheckable()">isCheckable</a>() 1230 </code> 1231 1232 <p>Checks if the UI element's <code>checkable</code> property is currently true. 1233 1234 1235</p> 1236 1237 </td> 1238 </tr> 1239 1240 1241 1242 <tr class="api apilevel-" > 1243 1244 1245 <td><code> 1246 1247 1248 1249 1250 1251 boolean</code> 1252 </td> 1253 1254 <td width="100%"> 1255 <code> 1256 <a href="/reference/android/support/test/uiautomator/UiObject.html#isChecked()">isChecked</a>() 1257 </code> 1258 1259 <p>Check if the UI element's <code>checked</code> property is currently true 1260 1261 1262</p> 1263 1264 </td> 1265 </tr> 1266 1267 1268 1269 <tr class="api apilevel-" > 1270 1271 1272 <td><code> 1273 1274 1275 1276 1277 1278 boolean</code> 1279 </td> 1280 1281 <td width="100%"> 1282 <code> 1283 <a href="/reference/android/support/test/uiautomator/UiObject.html#isClickable()">isClickable</a>() 1284 </code> 1285 1286 <p>Checks if the UI element's <code>clickable</code> property is currently true. 1287 1288 1289</p> 1290 1291 </td> 1292 </tr> 1293 1294 1295 1296 <tr class="api apilevel-" > 1297 1298 1299 <td><code> 1300 1301 1302 1303 1304 1305 boolean</code> 1306 </td> 1307 1308 <td width="100%"> 1309 <code> 1310 <a href="/reference/android/support/test/uiautomator/UiObject.html#isEnabled()">isEnabled</a>() 1311 </code> 1312 1313 <p>Checks if the UI element's <code>enabled</code> property is currently true. 1314 1315 1316</p> 1317 1318 </td> 1319 </tr> 1320 1321 1322 1323 <tr class="api apilevel-" > 1324 1325 1326 <td><code> 1327 1328 1329 1330 1331 1332 boolean</code> 1333 </td> 1334 1335 <td width="100%"> 1336 <code> 1337 <a href="/reference/android/support/test/uiautomator/UiObject.html#isFocusable()">isFocusable</a>() 1338 </code> 1339 1340 <p>Check if the UI element's <code>focusable</code> property is currently true. 1341 1342 1343</p> 1344 1345 </td> 1346 </tr> 1347 1348 1349 1350 <tr class="api apilevel-" > 1351 1352 1353 <td><code> 1354 1355 1356 1357 1358 1359 boolean</code> 1360 </td> 1361 1362 <td width="100%"> 1363 <code> 1364 <a href="/reference/android/support/test/uiautomator/UiObject.html#isFocused()">isFocused</a>() 1365 </code> 1366 1367 <p>Check if the UI element's <code>focused</code> property is currently true 1368 1369 1370</p> 1371 1372 </td> 1373 </tr> 1374 1375 1376 1377 <tr class="api apilevel-" > 1378 1379 1380 <td><code> 1381 1382 1383 1384 1385 1386 boolean</code> 1387 </td> 1388 1389 <td width="100%"> 1390 <code> 1391 <a href="/reference/android/support/test/uiautomator/UiObject.html#isLongClickable()">isLongClickable</a>() 1392 </code> 1393 1394 <p>Check if the view's <code>long-clickable</code> property is currently true 1395 1396 1397</p> 1398 1399 </td> 1400 </tr> 1401 1402 1403 1404 <tr class="api apilevel-" > 1405 1406 1407 <td><code> 1408 1409 1410 1411 1412 1413 boolean</code> 1414 </td> 1415 1416 <td width="100%"> 1417 <code> 1418 <a href="/reference/android/support/test/uiautomator/UiObject.html#isScrollable()">isScrollable</a>() 1419 </code> 1420 1421 <p>Check if the view's <code>scrollable</code> property is currently true 1422 1423 1424</p> 1425 1426 </td> 1427 </tr> 1428 1429 1430 1431 <tr class="api apilevel-" > 1432 1433 1434 <td><code> 1435 1436 1437 1438 1439 1440 boolean</code> 1441 </td> 1442 1443 <td width="100%"> 1444 <code> 1445 <a href="/reference/android/support/test/uiautomator/UiObject.html#isSelected()">isSelected</a>() 1446 </code> 1447 1448 <p>Checks if the UI element's <code>selected</code> property is currently true. 1449 1450 1451</p> 1452 1453 </td> 1454 </tr> 1455 1456 1457 1458 <tr class="api apilevel-" > 1459 1460 1461 <td><code> 1462 1463 1464 1465 1466 1467 boolean</code> 1468 </td> 1469 1470 <td width="100%"> 1471 <code> 1472 <a href="/reference/android/support/test/uiautomator/UiObject.html#longClick()">longClick</a>() 1473 </code> 1474 1475 <p>Long clicks the center of the visible bounds of the UI element 1476 1477 1478</p> 1479 1480 </td> 1481 </tr> 1482 1483 1484 1485 <tr class="api apilevel-" > 1486 1487 1488 <td><code> 1489 1490 1491 1492 1493 1494 boolean</code> 1495 </td> 1496 1497 <td width="100%"> 1498 <code> 1499 <a href="/reference/android/support/test/uiautomator/UiObject.html#longClickBottomRight()">longClickBottomRight</a>() 1500 </code> 1501 1502 <p>Long clicks bottom and right corner of the UI element 1503 1504 1505</p> 1506 1507 </td> 1508 </tr> 1509 1510 1511 1512 <tr class="api apilevel-" > 1513 1514 1515 <td><code> 1516 1517 1518 1519 1520 1521 boolean</code> 1522 </td> 1523 1524 <td width="100%"> 1525 <code> 1526 <a href="/reference/android/support/test/uiautomator/UiObject.html#longClickTopLeft()">longClickTopLeft</a>() 1527 </code> 1528 1529 <p>Long clicks on the top and left corner of the UI element 1530 1531 1532</p> 1533 1534 </td> 1535 </tr> 1536 1537 1538 1539 <tr class="api apilevel-" > 1540 1541 1542 <td><code> 1543 1544 1545 1546 1547 1548 boolean</code> 1549 </td> 1550 1551 <td width="100%"> 1552 <code> 1553 <a href="/reference/android/support/test/uiautomator/UiObject.html#performMultiPointerGesture(android.view.MotionEvent.PointerCoords[]...)">performMultiPointerGesture</a>(PointerCoords... touches) 1554 </code> 1555 1556 <p>Performs a multi-touch gesture. 1557 1558 1559</p> 1560 1561 </td> 1562 </tr> 1563 1564 1565 1566 <tr class="api apilevel-" > 1567 1568 1569 <td><code> 1570 1571 1572 1573 1574 1575 boolean</code> 1576 </td> 1577 1578 <td width="100%"> 1579 <code> 1580 <a href="/reference/android/support/test/uiautomator/UiObject.html#performTwoPointerGesture(android.graphics.Point, android.graphics.Point, android.graphics.Point, android.graphics.Point, int)">performTwoPointerGesture</a>(Point startPoint1, Point startPoint2, Point endPoint1, Point endPoint2, int steps) 1581 </code> 1582 1583 <p>Generates a two-pointer gesture with arbitrary starting and ending points. 1584 1585 1586</p> 1587 1588 </td> 1589 </tr> 1590 1591 1592 1593 <tr class="api apilevel-" > 1594 1595 1596 <td><code> 1597 1598 1599 1600 1601 1602 boolean</code> 1603 </td> 1604 1605 <td width="100%"> 1606 <code> 1607 <a href="/reference/android/support/test/uiautomator/UiObject.html#pinchIn(int, int)">pinchIn</a>(int percent, int steps) 1608 </code> 1609 1610 <p>Performs a two-pointer gesture, where each pointer moves diagonally 1611 toward the other, from the edges to the center of this UiObject . 1612 1613 1614</p> 1615 1616 </td> 1617 </tr> 1618 1619 1620 1621 <tr class="api apilevel-" > 1622 1623 1624 <td><code> 1625 1626 1627 1628 1629 1630 boolean</code> 1631 </td> 1632 1633 <td width="100%"> 1634 <code> 1635 <a href="/reference/android/support/test/uiautomator/UiObject.html#pinchOut(int, int)">pinchOut</a>(int percent, int steps) 1636 </code> 1637 1638 <p>Performs a two-pointer gesture, where each pointer moves diagonally 1639 opposite across the other, from the center out towards the edges of the 1640 this UiObject. 1641 1642 1643</p> 1644 1645 </td> 1646 </tr> 1647 1648 1649 1650 <tr class="api apilevel-" > 1651 1652 1653 <td><code> 1654 1655 1656 1657 1658 1659 boolean</code> 1660 </td> 1661 1662 <td width="100%"> 1663 <code> 1664 <a href="/reference/android/support/test/uiautomator/UiObject.html#setText(java.lang.String)">setText</a>(String text) 1665 </code> 1666 1667 <p>Sets the text in an editable field, after clearing the field's content. 1668 1669 1670</p> 1671 1672 </td> 1673 </tr> 1674 1675 1676 1677 <tr class="api apilevel-" > 1678 1679 1680 <td><code> 1681 1682 1683 1684 1685 1686 boolean</code> 1687 </td> 1688 1689 <td width="100%"> 1690 <code> 1691 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeDown(int)">swipeDown</a>(int steps) 1692 </code> 1693 1694 <p>Performs the swipe down action on the UiObject. 1695 1696 1697</p> 1698 1699 </td> 1700 </tr> 1701 1702 1703 1704 <tr class="api apilevel-" > 1705 1706 1707 <td><code> 1708 1709 1710 1711 1712 1713 boolean</code> 1714 </td> 1715 1716 <td width="100%"> 1717 <code> 1718 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeLeft(int)">swipeLeft</a>(int steps) 1719 </code> 1720 1721 <p>Performs the swipe left action on the UiObject. 1722 1723 1724</p> 1725 1726 </td> 1727 </tr> 1728 1729 1730 1731 <tr class="api apilevel-" > 1732 1733 1734 <td><code> 1735 1736 1737 1738 1739 1740 boolean</code> 1741 </td> 1742 1743 <td width="100%"> 1744 <code> 1745 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeRight(int)">swipeRight</a>(int steps) 1746 </code> 1747 1748 <p>Performs the swipe right action on the UiObject. 1749 1750 1751</p> 1752 1753 </td> 1754 </tr> 1755 1756 1757 1758 <tr class="api apilevel-" > 1759 1760 1761 <td><code> 1762 1763 1764 1765 1766 1767 boolean</code> 1768 </td> 1769 1770 <td width="100%"> 1771 <code> 1772 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeUp(int)">swipeUp</a>(int steps) 1773 </code> 1774 1775 <p>Performs the swipe up action on the UiObject. 1776 1777 1778</p> 1779 1780 </td> 1781 </tr> 1782 1783 1784 1785 <tr class="api apilevel-" > 1786 1787 1788 <td><code> 1789 1790 1791 1792 1793 1794 boolean</code> 1795 </td> 1796 1797 <td width="100%"> 1798 <code> 1799 <a href="/reference/android/support/test/uiautomator/UiObject.html#waitForExists(long)">waitForExists</a>(long timeout) 1800 </code> 1801 1802 <p>Waits a specified length of time for a view to become visible. 1803 1804 1805</p> 1806 1807 </td> 1808 </tr> 1809 1810 1811 1812 <tr class="api apilevel-" > 1813 1814 1815 <td><code> 1816 1817 1818 1819 1820 1821 boolean</code> 1822 </td> 1823 1824 <td width="100%"> 1825 <code> 1826 <a href="/reference/android/support/test/uiautomator/UiObject.html#waitUntilGone(long)">waitUntilGone</a>(long timeout) 1827 </code> 1828 1829 <p>Waits a specified length of time for a view to become undetectable. 1830 1831 1832</p> 1833 1834 </td> 1835 </tr> 1836 1837 1838 1839 </table> 1840 </div> 1841</div> 1842</td></tr> 1843 1844 1845 1846<tr class="api apilevel-" > 1847<td colspan="2"> 1848 1849 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 1850 ><img height="34" id="inherited-methods-java.lang.Object-trigger" 1851 src="/assets/images/styles/disclosure_down.png" 1852 class="jd-expando-trigger-img" /></a>From 1853class 1854<code> 1855 1856 java.lang.Object 1857 1858</code> 1859<div id="inherited-methods-java.lang.Object"> 1860 <div id="inherited-methods-java.lang.Object-list" 1861 class="jd-inheritedlinks"> 1862 </div> 1863 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 1864 <table class="jd-sumtable-expando responsive"> 1865 1866 1867 1868 1869 <tr class="api apilevel-" > 1870 1871 1872 <td><code> 1873 1874 1875 1876 1877 1878 Object</code> 1879 </td> 1880 1881 <td width="100%"> 1882 <code> 1883 clone() 1884 </code> 1885 1886 </td> 1887 </tr> 1888 1889 1890 1891 <tr class="api apilevel-" > 1892 1893 1894 <td><code> 1895 1896 1897 1898 1899 1900 boolean</code> 1901 </td> 1902 1903 <td width="100%"> 1904 <code> 1905 equals(Object arg0) 1906 </code> 1907 1908 </td> 1909 </tr> 1910 1911 1912 1913 <tr class="api apilevel-" > 1914 1915 1916 <td><code> 1917 1918 1919 1920 1921 1922 void</code> 1923 </td> 1924 1925 <td width="100%"> 1926 <code> 1927 finalize() 1928 </code> 1929 1930 </td> 1931 </tr> 1932 1933 1934 1935 <tr class="api apilevel-" > 1936 1937 1938 <td><code> 1939 1940 1941 1942 final 1943 1944 Class<?></code> 1945 </td> 1946 1947 <td width="100%"> 1948 <code> 1949 getClass() 1950 </code> 1951 1952 </td> 1953 </tr> 1954 1955 1956 1957 <tr class="api apilevel-" > 1958 1959 1960 <td><code> 1961 1962 1963 1964 1965 1966 int</code> 1967 </td> 1968 1969 <td width="100%"> 1970 <code> 1971 hashCode() 1972 </code> 1973 1974 </td> 1975 </tr> 1976 1977 1978 1979 <tr class="api apilevel-" > 1980 1981 1982 <td><code> 1983 1984 1985 1986 final 1987 1988 void</code> 1989 </td> 1990 1991 <td width="100%"> 1992 <code> 1993 notify() 1994 </code> 1995 1996 </td> 1997 </tr> 1998 1999 2000 2001 <tr class="api apilevel-" > 2002 2003 2004 <td><code> 2005 2006 2007 2008 final 2009 2010 void</code> 2011 </td> 2012 2013 <td width="100%"> 2014 <code> 2015 notifyAll() 2016 </code> 2017 2018 </td> 2019 </tr> 2020 2021 2022 2023 <tr class="api apilevel-" > 2024 2025 2026 <td><code> 2027 2028 2029 2030 2031 2032 String</code> 2033 </td> 2034 2035 <td width="100%"> 2036 <code> 2037 toString() 2038 </code> 2039 2040 </td> 2041 </tr> 2042 2043 2044 2045 <tr class="api apilevel-" > 2046 2047 2048 <td><code> 2049 2050 2051 2052 final 2053 2054 void</code> 2055 </td> 2056 2057 <td width="100%"> 2058 <code> 2059 wait(long arg0, int arg1) 2060 </code> 2061 2062 </td> 2063 </tr> 2064 2065 2066 2067 <tr class="api apilevel-" > 2068 2069 2070 <td><code> 2071 2072 2073 2074 final 2075 2076 void</code> 2077 </td> 2078 2079 <td width="100%"> 2080 <code> 2081 wait(long arg0) 2082 </code> 2083 2084 </td> 2085 </tr> 2086 2087 2088 2089 <tr class="api apilevel-" > 2090 2091 2092 <td><code> 2093 2094 2095 2096 final 2097 2098 void</code> 2099 </td> 2100 2101 <td width="100%"> 2102 <code> 2103 wait() 2104 </code> 2105 2106 </td> 2107 </tr> 2108 2109 2110 2111 </table> 2112 </div> 2113</div> 2114</td></tr> 2115 2116 2117</table> 2118 2119 2120 2121<!-- XML Attributes --> 2122 2123 2124<!-- Enum Values --> 2125 2126 2127<!-- Constants --> 2128 2129 2130<!-- Fields --> 2131 2132 2133<!-- Public ctors --> 2134 2135 2136<!-- ========= CONSTRUCTOR DETAIL ======== --> 2137<h2 class="api-section">Public constructors</h2> 2138 2139 2140 2141<A NAME="UiCollection(android.support.test.uiautomator.UiSelector)"></A> 2142 2143<div class="api apilevel-"> 2144 <h3 class="api-name">UiCollection</h3> 2145 <div class="api-level"> 2146 <div></div> 2147 2148 2149 2150 </div> 2151<pre class="api-signature no-pretty-print"> 2152UiCollection (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector)</pre> 2153 2154 2155 2156 2157 <p>Constructs an instance as described by the selector</p> 2158 2159 2160</div> 2161 2162 2163 2164 2165 2166<!-- ========= CONSTRUCTOR DETAIL ======== --> 2167<!-- Protected ctors --> 2168 2169 2170 2171<!-- ========= METHOD DETAIL ======== --> 2172<!-- Public methdos --> 2173 2174<h2 class="api-section">Public methods</h2> 2175 2176 2177 2178<A NAME="getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)"></A> 2179 2180<div class="api apilevel-"> 2181 <h3 class="api-name">getChildByDescription</h3> 2182 <div class="api-level"> 2183 <div></div> 2184 2185 2186 2187 </div> 2188<pre class="api-signature no-pretty-print"> 2189<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByDescription (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 2190 String text)</pre> 2191 2192 2193 2194 2195 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 2196 selector. 2197 2198 It looks for any child matching the <code>childPattern</code> argument that has 2199 a child UI element anywhere within its sub hierarchy that has content-description text. 2200 The returned UiObject will point at the <code>childPattern</code> instance that matched the 2201 search and not at the identifying child element that matched the content description.</p></p> 2202 2203 <table class="responsive"> 2204 <tr><th colspan=2>Parameters</th></tr> 2205 <tr> 2206 <td><code>childPattern</code></td> 2207 <td width="100%"> 2208 <code>UiSelector</code>: 2209 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> 2210 </tr> 2211 <tr> 2212 <td><code>text</code></td> 2213 <td width="100%"> 2214 <code>String</code>: 2215 String of the identifying child contents of of the <code>childPattern</code></td> 2216 </tr> 2217 </table> 2218 <table class="responsive"> 2219 <tr><th colspan=2>Returns</th></tr> 2220 <tr> 2221 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 2222 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></td> 2223 </tr> 2224 </table> 2225 <table class="responsive"> 2226 <tr><th colspan=2>Throws</th></tr> 2227 <tr> 2228 <td><code></code></td> 2229 <td width="100%">UiObjectNotFoundException</td> 2230 </tr> 2231 <tr> 2232 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 2233 <td width="100%"></td> 2234 </tr> 2235 </table> 2236 2237 2238</div> 2239 2240 2241<A NAME="getChildByInstance(android.support.test.uiautomator.UiSelector, int)"></A> 2242 2243<div class="api apilevel-"> 2244 <h3 class="api-name">getChildByInstance</h3> 2245 <div class="api-level"> 2246 <div></div> 2247 2248 2249 2250 </div> 2251<pre class="api-signature no-pretty-print"> 2252<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByInstance (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 2253 int instance)</pre> 2254 2255 2256 2257 2258 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 2259 selector. 2260 2261 It looks for any child matching the <code>childPattern</code> argument that has 2262 a child UI element anywhere within its sub hierarchy that is at the <code>instance</code> 2263 specified. The operation is performed only on the visible items and no scrolling is performed 2264 in this case.</p> 2265 2266 <table class="responsive"> 2267 <tr><th colspan=2>Parameters</th></tr> 2268 <tr> 2269 <td><code>childPattern</code></td> 2270 <td width="100%"> 2271 <code>UiSelector</code>: 2272 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> 2273 </tr> 2274 <tr> 2275 <td><code>instance</code></td> 2276 <td width="100%"> 2277 <code>int</code>: 2278 int the desired matched instance of this <code>childPattern</code></td> 2279 </tr> 2280 </table> 2281 <table class="responsive"> 2282 <tr><th colspan=2>Returns</th></tr> 2283 <tr> 2284 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 2285 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></td> 2286 </tr> 2287 </table> 2288 <table class="responsive"> 2289 <tr><th colspan=2>Throws</th></tr> 2290 <tr> 2291 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 2292 <td width="100%"></td> 2293 </tr> 2294 </table> 2295 2296 2297</div> 2298 2299 2300<A NAME="getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)"></A> 2301 2302<div class="api apilevel-"> 2303 <h3 class="api-name">getChildByText</h3> 2304 <div class="api-level"> 2305 <div></div> 2306 2307 2308 2309 </div> 2310<pre class="api-signature no-pretty-print"> 2311<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByText (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 2312 String text)</pre> 2313 2314 2315 2316 2317 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 2318 selector. 2319 2320 It looks for any child matching the <code>childPattern</code> argument that has 2321 a child UI element anywhere within its sub hierarchy that has text attribute = 2322 <code>text</code>. The returned UiObject will point at the <code>childPattern</code> 2323 instance that matched the search and not at the identifying child element that matched the 2324 text attribute.</p></p> 2325 2326 <table class="responsive"> 2327 <tr><th colspan=2>Parameters</th></tr> 2328 <tr> 2329 <td><code>childPattern</code></td> 2330 <td width="100%"> 2331 <code>UiSelector</code>: 2332 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> 2333 </tr> 2334 <tr> 2335 <td><code>text</code></td> 2336 <td width="100%"> 2337 <code>String</code>: 2338 String of the identifying child contents of of the <code>childPattern</code></td> 2339 </tr> 2340 </table> 2341 <table class="responsive"> 2342 <tr><th colspan=2>Returns</th></tr> 2343 <tr> 2344 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 2345 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></td> 2346 </tr> 2347 </table> 2348 <table class="responsive"> 2349 <tr><th colspan=2>Throws</th></tr> 2350 <tr> 2351 <td><code></code></td> 2352 <td width="100%">UiObjectNotFoundException</td> 2353 </tr> 2354 <tr> 2355 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 2356 <td width="100%"></td> 2357 </tr> 2358 </table> 2359 2360 2361</div> 2362 2363 2364<A NAME="getChildCount(android.support.test.uiautomator.UiSelector)"></A> 2365 2366<div class="api apilevel-"> 2367 <h3 class="api-name">getChildCount</h3> 2368 <div class="api-level"> 2369 <div></div> 2370 2371 2372 2373 </div> 2374<pre class="api-signature no-pretty-print"> 2375int getChildCount (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern)</pre> 2376 2377 2378 2379 2380 <p>Counts child UI element instances matching the <code>childPattern</code> 2381 argument. The method returns the number of matching UI elements that are 2382 currently visible. The count does not include items of a scrollable list 2383 that are off-screen.</p> 2384 2385 <table class="responsive"> 2386 <tr><th colspan=2>Parameters</th></tr> 2387 <tr> 2388 <td><code>childPattern</code></td> 2389 <td width="100%"> 2390 <code>UiSelector</code>: 2391 a <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> that represents the matching child UI 2392 elements to count</td> 2393 </tr> 2394 </table> 2395 <table class="responsive"> 2396 <tr><th colspan=2>Returns</th></tr> 2397 <tr> 2398 <td><code>int</code></td> 2399 <td width="100%">the number of matched childPattern under the current <code><a href="/reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a></code></td> 2400 </tr> 2401 </table> 2402 2403</div> 2404 2405 2406 2407 2408 2409<!-- ========= METHOD DETAIL ======== --> 2410 2411 2412 2413<!-- ========= END OF CLASS DATA ========= --> 2414 2415</div><!-- end jd-content --> 2416 2417 2418 2419<div class="data-reference-resources-wrapper"> 2420 2421 <ul data-reference-resources> 2422 2423 2424 <li><h2>Interfaces</h2> 2425 <ul> 2426 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/IAutomationSupport.html">IAutomationSupport</a></li> 2427 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></li> 2428 </ul> 2429 </li> 2430 2431 <li><h2>Classes</h2> 2432 <ul> 2433 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/By.html">By</a></li> 2434 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/BySelector.html">BySelector</a></li> 2435 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/Configurator.html">Configurator</a></li> 2436 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/EventCondition.html">EventCondition</a></li> 2437 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/SearchCondition.html">SearchCondition</a></li> 2438 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html">UiAutomatorInstrumentationTestRunner</a></li> 2439 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiAutomatorTestCase.html">UiAutomatorTestCase</a></li> 2440 <li class="selected api apilevel-"><a href="/reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a></li> 2441 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a></li> 2442 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></li> 2443 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a></li> 2444 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObject2Condition.html">UiObject2Condition</a></li> 2445 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></li> 2446 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></li> 2447 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/Until.html">Until</a></li> 2448 </ul> 2449 </li> 2450 2451 <li><h2>Enums</h2> 2452 <ul> 2453 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/Direction.html">Direction</a></li> 2454 </ul> 2455 </li> 2456 2457 <li><h2>Exceptions</h2> 2458 <ul> 2459 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/StaleObjectException.html">StaleObjectException</a></li> 2460 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></li> 2461 </ul> 2462 </li> 2463 2464 </ul> 2465 2466</div> 2467 2468 2469 2470</body> 2471</html> 2472