1 page.title=UiCollection 2 parent.title=uiautomator 3 parent.link=index.html 4 @jd:body 5 <style> 6 h4.jd-details-title {background-color: #DEE8F1;} 7 </style> 8 <p>Used to enumerate a container's user interface (UI) elements for the purpose of counting, 9 or targeting a sub elements by a child's text or description. 10 </p> 11 12 13 <h2>Summary</h2> 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 <!-- ======== CONSTRUCTOR SUMMARY ======== --> 38 <table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> 39 40 41 42 43 <tr class="api" > 44 <td class="jd-typecol"> 45 46 47 48 49 50 51 </td> 52 <td class="jd-linkcol" width="100%"> 53 <span class="sympad"><a href="#UiCollection(com.android.uiautomator.core.UiSelector)">UiCollection</a></span>(<a href="UiSelector.html">UiSelector</a> selector) 54 55 </td></tr> 56 57 58 59 </table> 60 61 62 63 64 65 66 <!-- ========== METHOD SUMMARY =========== --> 67 <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> 68 69 70 71 72 <tr class="api" > 73 <td class="jd-typecol"> 74 75 76 77 78 79 <a href="UiObject.html">UiObject</a> 80 </td> 81 <td class="jd-linkcol" width="100%"> 82 <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) 83 84 <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> 85 selector.</div> 86 87 </td></tr> 88 89 90 91 <tr class="api" > 92 <td class="jd-typecol"> 93 94 95 96 97 98 <a href="UiObject.html">UiObject</a> 99 </td> 100 <td class="jd-linkcol" width="100%"> 101 <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) 102 103 <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> 104 105 </td></tr> 106 107 108 109 <tr class="api" > 110 <td class="jd-typecol"> 111 112 113 114 115 116 <a href="UiObject.html">UiObject</a> 117 </td> 118 <td class="jd-linkcol" width="100%"> 119 <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) 120 121 <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> 122 123 </td></tr> 124 125 126 127 <tr class="api" > 128 <td class="jd-typecol"> 129 130 131 132 133 134 int 135 </td> 136 <td class="jd-linkcol" width="100%"> 137 <span class="sympad"><a href="#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) 138 139 <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> 140 argument.</div> 141 142 </td></tr> 143 144 145 146 </table> 147 148 149 150 151 152 153 154 <!-- ========== METHOD SUMMARY =========== --> 155 <table id="inhmethods" class="jd-sumtable"><tr><th> 156 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> 157 <div style="clear:left;">Inherited Methods</div></th></tr> 158 159 160 <tr class="api apilevel-" > 161 <td colspan="12"> 162 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" 163 ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" 164 src="../../../../../assets/images/triangle-closed.png" 165 class="jd-expando-trigger-img" /></a> 166 From class 167 168 <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> 169 170 <div id="inherited-methods-com.android.uiautomator.core.UiObject"> 171 <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" 172 class="jd-inheritedlinks"> 173 </div> 174 <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> 175 <table class="jd-sumtable-expando"> 176 177 178 179 180 <tr class="api" > 181 <td class="jd-typecol"> 182 183 184 185 186 187 void 188 </td> 189 <td class="jd-linkcol" width="100%"> 190 <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() 191 192 <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> 193 194 </td></tr> 195 196 197 198 <tr class="api" > 199 <td class="jd-typecol"> 200 201 202 203 204 205 boolean 206 </td> 207 <td class="jd-linkcol" width="100%"> 208 <span class="sympad"><a href="UiObject.html#click()">click</a></span>() 209 210 <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented 211 by this UiObject.</div> 212 213 </td></tr> 214 215 216 217 <tr class="api" > 218 <td class="jd-typecol"> 219 220 221 222 223 224 boolean 225 </td> 226 <td class="jd-linkcol" width="100%"> 227 <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) 228 229 <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented 230 by this UiObject and waits for window transitions.</div> 231 232 </td></tr> 233 234 235 236 <tr class="api" > 237 <td class="jd-typecol"> 238 239 240 241 242 243 boolean 244 </td> 245 <td class="jd-linkcol" width="100%"> 246 <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() 247 248 <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> 249 This method is intended to reliably wait for window transitions that would typically take 250 longer than the usual default timeouts.</div> 251 252 </td></tr> 253 254 255 256 <tr class="api" > 257 <td class="jd-typecol"> 258 259 260 261 262 263 boolean 264 </td> 265 <td class="jd-linkcol" width="100%"> 266 <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() 267 268 <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> 269 270 </td></tr> 271 272 273 274 <tr class="api" > 275 <td class="jd-typecol"> 276 277 278 279 280 281 boolean 282 </td> 283 <td class="jd-linkcol" width="100%"> 284 <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() 285 286 <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> 287 288 </td></tr> 289 290 291 292 <tr class="api" > 293 <td class="jd-typecol"> 294 295 296 297 298 299 boolean 300 </td> 301 <td class="jd-linkcol" width="100%"> 302 <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() 303 304 <div class="jd-descrdiv">Check if UI element exists.</div> 305 306 </td></tr> 307 308 309 310 <tr class="api" > 311 <td class="jd-typecol"> 312 313 314 315 316 317 Rect 318 </td> 319 <td class="jd-linkcol" width="100%"> 320 <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() 321 322 <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> 323 324 </td></tr> 325 326 327 328 <tr class="api" > 329 <td class="jd-typecol"> 330 331 332 333 334 335 <a href="UiObject.html">UiObject</a> 336 </td> 337 <td class="jd-linkcol" width="100%"> 338 <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) 339 340 <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented 341 by this UiObject.</div> 342 343 </td></tr> 344 345 346 347 <tr class="api" > 348 <td class="jd-typecol"> 349 350 351 352 353 354 int 355 </td> 356 <td class="jd-linkcol" width="100%"> 357 <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() 358 359 <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by 360 this UiObject.</div> 361 362 </td></tr> 363 364 365 366 <tr class="api" > 367 <td class="jd-typecol"> 368 369 370 371 372 373 String 374 </td> 375 <td class="jd-linkcol" width="100%"> 376 <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() 377 378 <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> 379 380 </td></tr> 381 382 383 384 <tr class="api" > 385 <td class="jd-typecol"> 386 387 388 389 390 391 <a href="UiObject.html">UiObject</a> 392 </td> 393 <td class="jd-linkcol" width="100%"> 394 <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) 395 396 <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently 397 represented by this object.</div> 398 399 </td></tr> 400 401 402 403 <tr class="api" > 404 <td class="jd-typecol"> 405 406 407 408 409 410 String 411 </td> 412 <td class="jd-linkcol" width="100%"> 413 <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() 414 415 <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> 416 417 </td></tr> 418 419 420 421 <tr class="api" > 422 <td class="jd-typecol"> 423 424 425 final 426 427 428 <a href="UiSelector.html">UiSelector</a> 429 </td> 430 <td class="jd-linkcol" width="100%"> 431 <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() 432 433 <div class="jd-descrdiv">Debugging helper.</div> 434 435 </td></tr> 436 437 438 439 <tr class="api" > 440 <td class="jd-typecol"> 441 442 443 444 445 446 String 447 </td> 448 <td class="jd-linkcol" width="100%"> 449 <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() 450 451 <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> 452 453 </td></tr> 454 455 456 457 <tr class="api" > 458 <td class="jd-typecol"> 459 460 461 462 463 464 Rect 465 </td> 466 <td class="jd-linkcol" width="100%"> 467 <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() 468 469 <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> 470 471 </td></tr> 472 473 474 475 <tr class="api" > 476 <td class="jd-typecol"> 477 478 479 480 481 482 boolean 483 </td> 484 <td class="jd-linkcol" width="100%"> 485 <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() 486 487 <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> 488 489 </td></tr> 490 491 492 493 <tr class="api" > 494 <td class="jd-typecol"> 495 496 497 498 499 500 boolean 501 </td> 502 <td class="jd-linkcol" width="100%"> 503 <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() 504 505 <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> 506 507 </td></tr> 508 509 510 511 <tr class="api" > 512 <td class="jd-typecol"> 513 514 515 516 517 518 boolean 519 </td> 520 <td class="jd-linkcol" width="100%"> 521 <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() 522 523 <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> 524 525 </td></tr> 526 527 528 529 <tr class="api" > 530 <td class="jd-typecol"> 531 532 533 534 535 536 boolean 537 </td> 538 <td class="jd-linkcol" width="100%"> 539 <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() 540 541 <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> 542 543 </td></tr> 544 545 546 547 <tr class="api" > 548 <td class="jd-typecol"> 549 550 551 552 553 554 boolean 555 </td> 556 <td class="jd-linkcol" width="100%"> 557 <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() 558 559 <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> 560 561 </td></tr> 562 563 564 565 <tr class="api" > 566 <td class="jd-typecol"> 567 568 569 570 571 572 boolean 573 </td> 574 <td class="jd-linkcol" width="100%"> 575 <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() 576 577 <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> 578 579 </td></tr> 580 581 582 583 <tr class="api" > 584 <td class="jd-typecol"> 585 586 587 588 589 590 boolean 591 </td> 592 <td class="jd-linkcol" width="100%"> 593 <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() 594 595 <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> 596 597 </td></tr> 598 599 600 601 <tr class="api" > 602 <td class="jd-typecol"> 603 604 605 606 607 608 boolean 609 </td> 610 <td class="jd-linkcol" width="100%"> 611 <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() 612 613 <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> 614 615 </td></tr> 616 617 618 619 <tr class="api" > 620 <td class="jd-typecol"> 621 622 623 624 625 626 boolean 627 </td> 628 <td class="jd-linkcol" width="100%"> 629 <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() 630 631 <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> 632 633 </td></tr> 634 635 636 637 <tr class="api" > 638 <td class="jd-typecol"> 639 640 641 642 643 644 boolean 645 </td> 646 <td class="jd-linkcol" width="100%"> 647 <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() 648 649 <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> 650 651 </td></tr> 652 653 654 655 <tr class="api" > 656 <td class="jd-typecol"> 657 658 659 660 661 662 boolean 663 </td> 664 <td class="jd-linkcol" width="100%"> 665 <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() 666 667 <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> 668 669 </td></tr> 670 671 672 673 <tr class="api" > 674 <td class="jd-typecol"> 675 676 677 678 679 680 boolean 681 </td> 682 <td class="jd-linkcol" width="100%"> 683 <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() 684 685 <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> 686 687 </td></tr> 688 689 690 691 <tr class="api" > 692 <td class="jd-typecol"> 693 694 695 696 697 698 boolean 699 </td> 700 <td class="jd-linkcol" width="100%"> 701 <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) 702 703 <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> 704 705 </td></tr> 706 707 708 709 <tr class="api" > 710 <td class="jd-typecol"> 711 712 713 714 715 716 boolean 717 </td> 718 <td class="jd-linkcol" width="100%"> 719 <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) 720 721 <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see 722 #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), 723 #scrollForward().</div> 724 725 </td></tr> 726 727 728 729 <tr class="api" > 730 <td class="jd-typecol"> 731 732 733 734 735 736 boolean 737 </td> 738 <td class="jd-linkcol" width="100%"> 739 <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) 740 741 <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> 742 743 </td></tr> 744 745 746 747 <tr class="api" > 748 <td class="jd-typecol"> 749 750 751 752 753 754 boolean 755 </td> 756 <td class="jd-linkcol" width="100%"> 757 <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) 758 759 <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> 760 761 </td></tr> 762 763 764 765 <tr class="api" > 766 <td class="jd-typecol"> 767 768 769 770 771 772 boolean 773 </td> 774 <td class="jd-linkcol" width="100%"> 775 <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) 776 777 <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> 778 779 </td></tr> 780 781 782 783 <tr class="api" > 784 <td class="jd-typecol"> 785 786 787 788 789 790 boolean 791 </td> 792 <td class="jd-linkcol" width="100%"> 793 <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) 794 795 <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> 796 797 </td></tr> 798 799 800 801 <tr class="api" > 802 <td class="jd-typecol"> 803 804 805 806 807 808 boolean 809 </td> 810 <td class="jd-linkcol" width="100%"> 811 <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) 812 813 <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> 814 815 </td></tr> 816 817 818 </table> 819 </div> 820 </div> 821 </td></tr> 822 823 824 825 <tr class="api apilevel-" > 826 <td colspan="12"> 827 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 828 ><img id="inherited-methods-java.lang.Object-trigger" 829 src="../../../../../assets/images/triangle-closed.png" 830 class="jd-expando-trigger-img" /></a> 831 From class 832 833 java.lang.Object 834 835 <div id="inherited-methods-java.lang.Object"> 836 <div id="inherited-methods-java.lang.Object-list" 837 class="jd-inheritedlinks"> 838 </div> 839 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 840 <table class="jd-sumtable-expando"> 841 842 843 844 845 <tr class="api" > 846 <td class="jd-typecol"> 847 848 849 850 851 852 boolean 853 </td> 854 <td class="jd-linkcol" width="100%"> 855 <span class="sympad">equals</span>(Object arg0) 856 857 </td></tr> 858 859 860 861 <tr class="api" > 862 <td class="jd-typecol"> 863 864 865 final 866 867 868 Class<?> 869 </td> 870 <td class="jd-linkcol" width="100%"> 871 <span class="sympad">getClass</span>() 872 873 </td></tr> 874 875 876 877 <tr class="api" > 878 <td class="jd-typecol"> 879 880 881 882 883 884 int 885 </td> 886 <td class="jd-linkcol" width="100%"> 887 <span class="sympad">hashCode</span>() 888 889 </td></tr> 890 891 892 893 <tr class="api" > 894 <td class="jd-typecol"> 895 896 897 final 898 899 900 void 901 </td> 902 <td class="jd-linkcol" width="100%"> 903 <span class="sympad">notify</span>() 904 905 </td></tr> 906 907 908 909 <tr class="api" > 910 <td class="jd-typecol"> 911 912 913 final 914 915 916 void 917 </td> 918 <td class="jd-linkcol" width="100%"> 919 <span class="sympad">notifyAll</span>() 920 921 </td></tr> 922 923 924 925 <tr class="api" > 926 <td class="jd-typecol"> 927 928 929 930 931 932 String 933 </td> 934 <td class="jd-linkcol" width="100%"> 935 <span class="sympad">toString</span>() 936 937 </td></tr> 938 939 940 941 <tr class="api" > 942 <td class="jd-typecol"> 943 944 945 final 946 947 948 void 949 </td> 950 <td class="jd-linkcol" width="100%"> 951 <span class="sympad">wait</span>() 952 953 </td></tr> 954 955 956 957 <tr class="api" > 958 <td class="jd-typecol"> 959 960 961 final 962 963 964 void 965 </td> 966 <td class="jd-linkcol" width="100%"> 967 <span class="sympad">wait</span>(long arg0, int arg1) 968 969 </td></tr> 970 971 972 973 <tr class="api" > 974 <td class="jd-typecol"> 975 976 977 final 978 979 980 void 981 </td> 982 <td class="jd-linkcol" width="100%"> 983 <span class="sympad">wait</span>(long arg0) 984 985 </td></tr> 986 987 988 </table> 989 </div> 990 </div> 991 </td></tr> 992 993 994 </table> 995 996 997 </div><!-- jd-descr (summary) --> 998 999 1000 <!-- ========= CONSTRUCTOR DETAIL ======== --> 1001 <h2>Public Constructors</h2> 1002 1003 1004 <a id="UiCollection(com.android.uiautomator.core.UiSelector)"></a> 1005 1006 <div class="jd-details api "> 1007 <h4 class="jd-details-title"> 1008 <span class="normal"> 1009 public 1010 1011 1012 1013 1014 1015 </span> 1016 <span class="sympad">UiCollection</span> 1017 <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> 1018 </h4> 1019 <div class="api-level"> 1020 <div> 1021 1022 </div> 1023 1024 1025 1026 </div> 1027 <div class="jd-details-descr"> 1028 1029 <div class="jd-tagdata jd-tagdescr"><p></p></div> 1030 1031 </div> 1032 </div> 1033 1034 1035 1036 <!-- ========= METHOD DETAIL ======== --> 1037 <!-- Public methdos --> 1038 1039 <h2>Public Methods</h2> 1040 1041 1042 <a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> 1043 1044 <div class="jd-details api "> 1045 <h4 class="jd-details-title"> 1046 <span class="normal"> 1047 public 1048 1049 1050 1051 1052 <a href="UiObject.html">UiObject</a> 1053 </span> 1054 <span class="sympad">getChildByDescription</span> 1055 <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> 1056 </h4> 1057 <div class="api-level"> 1058 <div> 1059 1060 </div> 1061 1062 1063 1064 </div> 1065 <div class="jd-details-descr"> 1066 1067 <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> 1068 selector. 1069 1070 It looks for any child matching the <code>childPattern</code> argument that has 1071 a child UI element anywhere within its sub hierarchy that has content-description text. 1072 The returned UiObject will point at the <code>childPattern</code> instance that matched the 1073 search and not at the identifying child element that matched the content description.</p></p></div> 1074 <div class="jd-tagdata"> 1075 <h5 class="jd-tagtitle">Parameters</h5> 1076 <table class="jd-tagtable"> 1077 <tr> 1078 <th>childPattern</th> 1079 <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> 1080 </tr> 1081 <tr> 1082 <th>text</th> 1083 <td>String of the identifying child contents of of the <code>childPattern</code></td> 1084 </tr> 1085 </table> 1086 </div> 1087 <div class="jd-tagdata"> 1088 <h5 class="jd-tagtitle">Returns</h5> 1089 <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> 1090 </div> 1091 <div class="jd-tagdata"> 1092 <h5 class="jd-tagtitle">Throws</h5> 1093 <table class="jd-tagtable"> 1094 <tr> 1095 <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> 1096 <td></td> 1097 </tr> 1098 </table> 1099 </div> 1100 1101 </div> 1102 </div> 1103 1104 1105 <a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> 1106 1107 <div class="jd-details api "> 1108 <h4 class="jd-details-title"> 1109 <span class="normal"> 1110 public 1111 1112 1113 1114 1115 <a href="UiObject.html">UiObject</a> 1116 </span> 1117 <span class="sympad">getChildByInstance</span> 1118 <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> 1119 </h4> 1120 <div class="api-level"> 1121 <div> 1122 1123 </div> 1124 1125 1126 1127 </div> 1128 <div class="jd-details-descr"> 1129 1130 <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>. 1131 1132 It looks for any child matching the <code>childPattern</code> argument that has 1133 a child UI element anywhere within its sub hierarchy that is at the <code>instance</code> 1134 specified. The operation is performed only on the visible items and no scrolling is performed 1135 in this case.</p></div> 1136 <div class="jd-tagdata"> 1137 <h5 class="jd-tagtitle">Parameters</h5> 1138 <table class="jd-tagtable"> 1139 <tr> 1140 <th>childPattern</th> 1141 <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> 1142 </tr> 1143 <tr> 1144 <th>instance</th> 1145 <td>int the desired matched instance of this <code>childPattern</code></td> 1146 </tr> 1147 </table> 1148 </div> 1149 <div class="jd-tagdata"> 1150 <h5 class="jd-tagtitle">Returns</h5> 1151 <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> 1152 </li></ul> 1153 </div> 1154 <div class="jd-tagdata"> 1155 <h5 class="jd-tagtitle">Throws</h5> 1156 <table class="jd-tagtable"> 1157 <tr> 1158 <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> 1159 <td></td> 1160 </tr> 1161 </table> 1162 </div> 1163 1164 </div> 1165 </div> 1166 1167 1168 <a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> 1169 1170 <div class="jd-details api "> 1171 <h4 class="jd-details-title"> 1172 <span class="normal"> 1173 public 1174 1175 1176 1177 1178 <a href="UiObject.html">UiObject</a> 1179 </span> 1180 <span class="sympad">getChildByText</span> 1181 <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> 1182 </h4> 1183 <div class="api-level"> 1184 <div> 1185 1186 </div> 1187 1188 1189 1190 </div> 1191 <div class="jd-details-descr"> 1192 1193 <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> 1194 selector. 1195 1196 It looks for any child matching the <code>childPattern</code> argument that has 1197 a child UI element anywhere within its sub hierarchy that has a text attribute equal to 1198 <code>text</code>. The returned UiObject will point at the <code>childPattern</code> 1199 instance that matched the search and not at the identifying child element that matched the 1200 text attribute.</p></p></div> 1201 <div class="jd-tagdata"> 1202 <h5 class="jd-tagtitle">Parameters</h5> 1203 <table class="jd-tagtable"> 1204 <tr> 1205 <th>childPattern</th> 1206 <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> 1207 </tr> 1208 <tr> 1209 <th>text</th> 1210 <td>String of the identifying child contents of of the <code>childPattern</code></td> 1211 </tr> 1212 </table> 1213 </div> 1214 <div class="jd-tagdata"> 1215 <h5 class="jd-tagtitle">Returns</h5> 1216 <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> 1217 </div> 1218 <div class="jd-tagdata"> 1219 <h5 class="jd-tagtitle">Throws</h5> 1220 <table class="jd-tagtable"> 1221 <tr> 1222 <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> 1223 <td></td> 1224 </tr> 1225 </table> 1226 </div> 1227 1228 </div> 1229 </div> 1230 1231 1232 <a id="getChildCount(com.android.uiautomator.core.UiSelector)"></a> 1233 1234 <div class="jd-details api "> 1235 <h4 class="jd-details-title"> 1236 <span class="normal"> 1237 public 1238 int 1239 </span> 1240 <span class="sympad">getChildCount</span> 1241 <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern)</span> 1242 </h4> 1243 <div class="api-level"> 1244 </div> 1245 <div class="jd-details-descr"> 1246 1247 <div class="jd-tagdata jd-tagdescr"><p>Counts child UI element instances matching the <code>childPattern</code> 1248 argument. The method returns the number of matching UI elements that are 1249 currently visible. The count does not include items of a scrollable list 1250 that are off-screen.</p></div> 1251 <div class="jd-tagdata"> 1252 <h5 class="jd-tagtitle">Parameters</h5> 1253 <table class="jd-tagtable"> 1254 <tr> 1255 <th>childPattern</th> 1256 <td>a <code><a href="UiSelector.html">UiSelector</a></code> that represents the matching child UI 1257 elements to count</td> 1258 </tr> 1259 </table> 1260 </div> 1261 <div class="jd-tagdata"> 1262 <h5 class="jd-tagtitle">Returns</h5> 1263 <ul class="nolist"><li>the number of matched childPattern under the current <code><a href="UiCollection.html">UiCollection</a></code> 1264 </li></ul> 1265 </div> 1266 1267 </div> 1268 1269