idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
22,700
public boolean searchEditText ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "searchEditText(\"" + text + "\")" ) ; } return searcher . searchWithTimeoutFor ( EditText . class , text , 1 , true , false ) ; }
Searches for a text in the EditText objects currently displayed and returns true if found . Will automatically scroll when needed .
22,701
public Activity getCurrentActivity ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getCurrentActivity()" ) ; } return activityUtils . getCurrentActivity ( false ) ; }
Returns the current Activity .
22,702
public void assertCurrentActivity ( String message , String name , boolean isNewInstance ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "assertCurrentActivity(" + message + ", " + name + ", " + isNewInstance + ")" ) ; } asserter . assertCurrentActivity ( message , name , isNewInstance ) ; }
Asserts that the Activity matching the specified name is active with the possibility to verify that the expected Activity is a new instance of the Activity .
22,703
@ SuppressWarnings ( "unchecked" ) public void assertCurrentActivity ( String message , @ SuppressWarnings ( "rawtypes" ) Class activityClass , boolean isNewInstance ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "assertCurrentActivity(\"" + message + "\", " + activityClass + ", " + isNewInstance + ")" ) ; } asserter . assertCurrentActivity ( message , activityClass , isNewInstance ) ; }
Asserts that the Activity matching the specified class is active with the possibility to verify that the expected Activity is a new instance of the Activity .
22,704
public boolean waitForDialogToOpen ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForDialogToOpen()" ) ; } return dialogUtils . waitForDialogToOpen ( Timeout . getLargeTimeout ( ) , true ) ; }
Waits for a Dialog to open . Default timeout is 20 seconds .
22,705
public boolean waitForDialogToClose ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForDialogToClose()" ) ; } return dialogUtils . waitForDialogToClose ( Timeout . getLargeTimeout ( ) ) ; }
Waits for a Dialog to close . Default timeout is 20 seconds .
22,706
public boolean waitForDialogToOpen ( long timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForDialogToOpen(" + timeout + ")" ) ; } return dialogUtils . waitForDialogToOpen ( timeout , true ) ; }
Waits for a Dialog to open .
22,707
public boolean waitForDialogToClose ( long timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForDialogToClose(" + timeout + ")" ) ; } return dialogUtils . waitForDialogToClose ( timeout ) ; }
Waits for a Dialog to close .
22,708
public void clickOnScreen ( float x , float y ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnScreen(" + x + ", " + y + ")" ) ; } sleeper . sleep ( ) ; clicker . clickOnScreen ( x , y , null ) ; }
Clicks the specified coordinates .
22,709
public void clickOnScreen ( float x , float y , int numberOfClicks ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnScreen(" + x + ", " + y + ", " + numberOfClicks + ")" ) ; } if ( android . os . Build . VERSION . SDK_INT < 14 ) { throw new RuntimeException ( "clickOnScreen(float x, float y, int numberOfClicks) requires API level >= 14" ) ; } tapper . generateTapGesture ( numberOfClicks , new PointF ( x , y ) ) ; }
Clicks the specified coordinates rapidly a specified number of times . Requires API level > = 14 .
22,710
public void clickLongOnScreen ( float x , float y ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickLongOnScreen(" + x + ", " + y + ")" ) ; } clicker . clickLongOnScreen ( x , y , 0 , null ) ; }
Long clicks the specified coordinates .
22,711
public void clickOnButton ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnButton(\"" + text + "\")" ) ; } clicker . clickOn ( Button . class , text ) ; }
Clicks a Button displaying the specified text . Will automatically scroll when needed .
22,712
public void clickOnImageButton ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnImageButton(" + index + ")" ) ; } clicker . clickOn ( ImageButton . class , index ) ; }
Clicks an ImageButton matching the specified index .
22,713
public void clickOnToggleButton ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnToggleButton(\"" + text + "\")" ) ; } clicker . clickOn ( ToggleButton . class , text ) ; }
Clicks a ToggleButton displaying the specified text .
22,714
public void clickOnMenuItem ( String text , boolean subMenu ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnMenuItem(\"" + text + "\", " + subMenu + ")" ) ; } clicker . clickOnMenuItem ( text , subMenu ) ; }
Clicks a MenuItem displaying the specified text .
22,715
public void clickOnWebElement ( WebElement webElement ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnWebElement(" + webElement + ")" ) ; } if ( webElement == null ) Assert . fail ( "WebElement is null and can therefore not be clicked!" ) ; clicker . clickOnScreen ( webElement . getLocationX ( ) , webElement . getLocationY ( ) , null ) ; }
Clicks the specified WebElement .
22,716
public void pressSoftKeyboardNextButton ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "pressSoftKeyboardNextButton()" ) ; } presser . pressSoftKeyboard ( EditorInfo . IME_ACTION_NEXT ) ; }
Presses the soft keyboard next button .
22,717
public void pressSoftKeyboardSearchButton ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "pressSoftKeyboardSearchButton()" ) ; } presser . pressSoftKeyboard ( EditorInfo . IME_ACTION_SEARCH ) ; }
Presses the soft keyboard search button .
22,718
public void pressSoftKeyboardGoButton ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "pressSoftKeyboardGoButton()" ) ; } presser . pressSoftKeyboard ( EditorInfo . IME_ACTION_GO ) ; }
Presses the soft keyboard go button .
22,719
public void pressSoftKeyboardDoneButton ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "pressSoftKeyboardDoneButton()" ) ; } presser . pressSoftKeyboard ( EditorInfo . IME_ACTION_DONE ) ; }
Presses the soft keyboard done button .
22,720
public void clickOnView ( View view ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnView(" + view + ")" ) ; } view = waiter . waitForView ( view , Timeout . getSmallTimeout ( ) ) ; clicker . clickOnScreen ( view ) ; }
Clicks the specified View .
22,721
public void clickLongOnView ( View view , int time ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickLongOnView(" + view + ", " + time + ")" ) ; } clicker . clickOnScreen ( view , true , time ) ; }
Long clicks the specified View for a specified amount of time .
22,722
public void clickOnText ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnText(\"" + text + "\")" ) ; } clicker . clickOnText ( text , false , 1 , true , 0 ) ; }
Clicks a View or WebElement displaying the specified text . Will automatically scroll when needed .
22,723
public void clickLongOnTextAndPress ( String text , int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickLongOnTextAndPress(\"" + text + "\", " + index + ")" ) ; } clicker . clickLongOnTextAndPress ( text , index ) ; }
Long clicks a View displaying the specified text and then selects an item from the context menu that appears . Will automatically scroll when needed .
22,724
public void clickOnButton ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnButton(" + index + ")" ) ; } clicker . clickOn ( Button . class , index ) ; }
Clicks a Button matching the specified index .
22,725
public void clickOnRadioButton ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnRadioButton(" + index + ")" ) ; } clicker . clickOn ( RadioButton . class , index ) ; }
Clicks a RadioButton matching the specified index .
22,726
public void clickOnCheckBox ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnCheckBox(" + index + ")" ) ; } clicker . clickOn ( CheckBox . class , index ) ; }
Clicks a CheckBox matching the specified index .
22,727
public void clickOnEditText ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnEditText(" + index + ")" ) ; } clicker . clickOn ( EditText . class , index ) ; }
Clicks an EditText matching the specified index .
22,728
public void clickInList ( int line , int index , int id ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickInList(" + line + ", " + index + ", " + id + ")" ) ; } clicker . clickInList ( line , index , id , false , 0 ) ; }
Clicks a View with a specified resource id on the specified line in the list matching the specified index
22,729
public ArrayList < TextView > clickLongInList ( int line , int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickLongInList(" + line + ", " + index + ")" ) ; } return clicker . clickInList ( line , index , 0 , true , 0 ) ; }
Long clicks the specified list line in the ListView matching the specified index and returns an ArrayList of the TextView objects that the list line is displaying .
22,730
public ArrayList < TextView > clickInRecyclerView ( int itemIndex ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickInRecyclerView(" + itemIndex + ")" ) ; } return clicker . clickInRecyclerView ( itemIndex ) ; }
Clicks the specified item index and returns an ArrayList of the TextView objects that the item index is displaying . Will use the first RecyclerView it finds .
22,731
public void clickInRecyclerView ( int itemIndex , int recyclerViewIndex , int id ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickInRecyclerView(" + itemIndex + ", " + recyclerViewIndex + ", " + id + ")" ) ; } clicker . clickInRecyclerView ( itemIndex , recyclerViewIndex , id , false , 0 ) ; }
Clicks a View with a specified resource id on the specified item index in the RecyclerView matching the specified RecyclerView index
22,732
public void clickOnActionBarItem ( int id ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnActionBarItem(" + id + ")" ) ; } clicker . clickOnActionBarItem ( id ) ; }
Clicks an ActionBarItem matching the specified resource id .
22,733
public Illustration . Builder createIllustrationBuilder ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "createIllustrationBuilder()" ) ; } return new Illustration . Builder ( ) ; }
An Builder pattern that will allow the client to build a new illustration
22,734
public void drag ( float fromX , float toX , float fromY , float toY , int stepCount ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "drag(" + fromX + ", " + toX + ", " + fromY + ", " + toY + ")" ) ; } dialogUtils . hideSoftKeyboard ( null , false , true ) ; scroller . drag ( fromX , toX , fromY , toY , stepCount ) ; }
Simulate touching the specified location and dragging it to a new location .
22,735
@ SuppressWarnings ( "unchecked" ) public void scrollToTop ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollToTop()" ) ; } View recyclerView = viewFetcher . getRecyclerView ( true , 0 ) ; if ( recyclerView != null ) { waiter . waitForViews ( true , AbsListView . class , ScrollView . class , WebView . class , recyclerView . getClass ( ) ) ; } else { waiter . waitForViews ( true , AbsListView . class , ScrollView . class , WebView . class ) ; } scroller . scroll ( Scroller . UP , true ) ; }
Scrolls to the top of the screen .
22,736
public boolean scrollDownList ( AbsListView list ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollDownList(" + list + ")" ) ; } return scroller . scrollList ( list , Scroller . DOWN , false ) ; }
Scrolls down the specified AbsListView .
22,737
public boolean scrollListToBottom ( AbsListView list ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToBottom(" + list + ")" ) ; } return scroller . scrollList ( list , Scroller . DOWN , true ) ; }
Scrolls to the bottom of the specified AbsListView .
22,738
public boolean scrollUpList ( AbsListView list ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollUpList(" + list + ")" ) ; } return scroller . scrollList ( list , Scroller . UP , false ) ; }
Scrolls up the specified AbsListView .
22,739
public boolean scrollListToTop ( AbsListView list ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToTop(" + list + ")" ) ; } return scroller . scrollList ( list , Scroller . UP , true ) ; }
Scrolls to the top of the specified AbsListView .
22,740
public boolean scrollDownList ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollDownList(" + index + ")" ) ; } return scroller . scrollList ( waiter . waitForAndGetView ( index , ListView . class ) , Scroller . DOWN , false ) ; }
Scrolls down a ListView matching the specified index .
22,741
public boolean scrollListToBottom ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToBottom(" + index + ")" ) ; } return scroller . scrollList ( waiter . waitForAndGetView ( index , ListView . class ) , Scroller . DOWN , true ) ; }
Scrolls a ListView matching the specified index to the bottom .
22,742
public boolean scrollUpList ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollUpList(" + index + ")" ) ; } return scroller . scrollList ( waiter . waitForAndGetView ( index , ListView . class ) , Scroller . UP , false ) ; }
Scrolls up a ListView matching the specified index .
22,743
public boolean scrollListToTop ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToTop(" + index + ")" ) ; } return scroller . scrollList ( waiter . waitForAndGetView ( index , ListView . class ) , Scroller . UP , true ) ; }
Scrolls a ListView matching the specified index to the top .
22,744
public void scrollListToLine ( AbsListView absListView , int line ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToLine(" + absListView + ", " + line + ")" ) ; } scroller . scrollListToLine ( absListView , line ) ; }
Scroll the specified AbsListView to the specified line .
22,745
public void scrollListToLine ( int index , int line ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollListToLine(" + index + ", " + line + ")" ) ; } scroller . scrollListToLine ( waiter . waitForAndGetView ( index , AbsListView . class ) , line ) ; }
Scroll a AbsListView matching the specified index to the specified line .
22,746
public boolean scrollDownRecyclerView ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollDownRecyclerView(" + index + ")" ) ; } if ( ! config . shouldScroll ) { return true ; } View recyclerView = viewFetcher . getRecyclerView ( index , Timeout . getSmallTimeout ( ) ) ; return scroller . scrollView ( recyclerView , Scroller . DOWN ) ; }
Scrolls down a RecyclerView matching the specified index .
22,747
public boolean scrollRecyclerViewToBottom ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollRecyclerViewToBottom(" + index + ")" ) ; } if ( ! config . shouldScroll ) { return true ; } View recyclerView = viewFetcher . getRecyclerView ( index , Timeout . getSmallTimeout ( ) ) ; scroller . scrollViewAllTheWay ( recyclerView , Scroller . DOWN ) ; return false ; }
Scrolls a RecyclerView matching the specified index to the bottom .
22,748
public boolean scrollRecyclerViewToTop ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "scrollRecyclerViewToTop(" + index + ")" ) ; } if ( ! config . shouldScroll ) { return false ; } View recyclerView = viewFetcher . getRecyclerView ( index , Timeout . getSmallTimeout ( ) ) ; scroller . scrollViewAllTheWay ( recyclerView , Scroller . UP ) ; return false ; }
Scrolls a RecyclerView matching the specified index to the top .
22,749
public void pinchToZoom ( PointF startPoint1 , PointF startPoint2 , PointF endPoint1 , PointF endPoint2 ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "pinchToZoom(" + startPoint1 + ", " + startPoint2 + ", " + endPoint1 + ", " + endPoint2 + ")" ) ; } if ( android . os . Build . VERSION . SDK_INT < 14 ) { throw new RuntimeException ( "pinchToZoom() requires API level >= 14" ) ; } zoomer . generateZoomGesture ( startPoint1 , startPoint2 , endPoint1 , endPoint2 ) ; }
Zooms in or out if startPoint1 and startPoint2 are larger or smaller then endPoint1 and endPoint2 . Requires API level > = 14 .
22,750
public void swipe ( PointF startPoint1 , PointF startPoint2 , PointF endPoint1 , PointF endPoint2 ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "swipe(" + startPoint1 + ", " + startPoint2 + ", " + endPoint1 + ", " + endPoint2 + ")" ) ; } if ( android . os . Build . VERSION . SDK_INT < 14 ) { throw new RuntimeException ( "swipe() requires API level >= 14" ) ; } swiper . generateSwipeGesture ( startPoint1 , startPoint2 , endPoint1 , endPoint2 ) ; }
Swipes with two fingers in a linear path determined by starting and ending points . Requires API level > = 14 .
22,751
public void setDatePicker ( int index , int year , int monthOfYear , int dayOfMonth ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setDatePicker(" + index + ", " + year + ", " + monthOfYear + ", " + dayOfMonth + ")" ) ; } setDatePicker ( waiter . waitForAndGetView ( index , DatePicker . class ) , year , monthOfYear , dayOfMonth ) ; }
Sets the date in a DatePicker matching the specified index .
22,752
public void setDatePicker ( DatePicker datePicker , int year , int monthOfYear , int dayOfMonth ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setDatePicker(" + datePicker + ", " + year + ", " + monthOfYear + ", " + dayOfMonth + ")" ) ; } datePicker = ( DatePicker ) waiter . waitForView ( datePicker , Timeout . getSmallTimeout ( ) ) ; setter . setDatePicker ( datePicker , year , monthOfYear , dayOfMonth ) ; }
Sets the date in the specified DatePicker .
22,753
public void setTimePicker ( int index , int hour , int minute ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setTimePicker(" + index + ", " + hour + ", " + minute + ")" ) ; } setTimePicker ( waiter . waitForAndGetView ( index , TimePicker . class ) , hour , minute ) ; }
Sets the time in a TimePicker matching the specified index .
22,754
public void setTimePicker ( TimePicker timePicker , int hour , int minute ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setTimePicker(" + timePicker + ", " + hour + ", " + minute + ")" ) ; } timePicker = ( TimePicker ) waiter . waitForView ( timePicker , Timeout . getSmallTimeout ( ) ) ; setter . setTimePicker ( timePicker , hour , minute ) ; }
Sets the time in the specified TimePicker .
22,755
public void enterText ( int index , String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "enterText(" + index + ", \"" + text + "\")" ) ; } textEnterer . setEditText ( waiter . waitForAndGetView ( index , EditText . class ) , text ) ; }
Enters text in an EditText matching the specified index .
22,756
public void enterTextInWebElement ( By by , String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "enterTextInWebElement(" + by + ", \"" + text + "\")" ) ; } if ( waiter . waitForWebElement ( by , 0 , Timeout . getSmallTimeout ( ) , false ) == null ) { Assert . fail ( "WebElement with " + webUtils . splitNameByUpperCase ( by . getClass ( ) . getSimpleName ( ) ) + ": '" + by . getValue ( ) + "' is not found!" ) ; } webUtils . enterTextIntoWebElement ( by , text ) ; }
Enters text in a WebElement matching the specified By object .
22,757
public void typeText ( EditText editText , String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "typeText(" + editText + ", \"" + text + "\")" ) ; } editText = ( EditText ) waiter . waitForView ( editText , Timeout . getSmallTimeout ( ) ) ; textEnterer . typeText ( editText , text ) ; }
Types text in the specified EditText .
22,758
public void typeTextInWebElement ( WebElement webElement , String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "typeTextInWebElement(" + webElement + ", \"" + text + "\")" ) ; } clickOnWebElement ( webElement ) ; dialogUtils . hideSoftKeyboard ( null , true , true ) ; instrumentation . sendStringSync ( text ) ; }
Types text in the specified WebElement .
22,759
public void clearTextInWebElement ( By by ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clearTextInWebElement(" + by + ")" ) ; } webUtils . enterTextIntoWebElement ( by , "" ) ; }
Clears text in a WebElement matching the specified By object .
22,760
public void clickOnImage ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnImage(" + index + ")" ) ; } clicker . clickOn ( ImageView . class , index ) ; }
Clicks an ImageView matching the specified index .
22,761
public EditText getEditText ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getEditText(" + index + ")" ) ; } return getter . getView ( EditText . class , index ) ; }
Returns an EditText matching the specified index .
22,762
public Button getButton ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getButton(" + index + ")" ) ; } return getter . getView ( Button . class , index ) ; }
Returns a Button matching the specified index .
22,763
public TextView getText ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getText(" + index + ")" ) ; } return getter . getView ( TextView . class , index ) ; }
Returns a TextView matching the specified index .
22,764
public ImageView getImage ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getImage(" + index + ")" ) ; } return getter . getView ( ImageView . class , index ) ; }
Returns an ImageView matching the specified index .
22,765
public ImageButton getImageButton ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getImageButton(" + index + ")" ) ; } return getter . getView ( ImageButton . class , index ) ; }
Returns an ImageButton matching the specified index .
22,766
public TextView getText ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getText(\"" + text + "\")" ) ; } return getter . getView ( TextView . class , text , false ) ; }
Returns a TextView displaying the specified text .
22,767
public Button getButton ( String text , boolean onlyVisible ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getButton(\"" + text + "\", " + onlyVisible + ")" ) ; } return getter . getView ( Button . class , text , onlyVisible ) ; }
Returns a Button displaying the specified text .
22,768
public EditText getEditText ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getEditText(\"" + text + "\")" ) ; } return getter . getView ( EditText . class , text , false ) ; }
Returns an EditText displaying the specified text .
22,769
public View getView ( int id ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getView(" + id + ")" ) ; } return getView ( id , 0 ) ; }
Returns a View matching the specified resource id .
22,770
public View getView ( Object tag ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getView(" + tag + ")" ) ; } return getView ( tag , 0 ) ; }
Returns a View matching the specified tag .
22,771
public View getView ( Object tag , int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getView(" + tag + ", " + index + ")" ) ; } View viewToReturn = getter . getView ( tag , index ) ; if ( viewToReturn == null ) { int match = index + 1 ; if ( match > 1 ) { Assert . fail ( match + " Views with id: '" + tag + "' are not found!" ) ; } else { Assert . fail ( "View with id: '" + tag + "' is not found!" ) ; } } return viewToReturn ; }
Returns a View matching the specified tag and index .
22,772
public < T extends View > T getView ( Class < T > viewClass , int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getView(" + viewClass + ", " + index + ")" ) ; } return waiter . waitForAndGetView ( index , viewClass ) ; }
Returns a View matching the specified class and index .
22,773
public WebElement getWebElement ( By by , int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getWebElement(" + by + ", " + index + ")" ) ; } int match = index + 1 ; WebElement webElement = waiter . waitForWebElement ( by , match , Timeout . getSmallTimeout ( ) , true ) ; if ( webElement == null ) { if ( match > 1 ) { Assert . fail ( match + " WebElements with " + webUtils . splitNameByUpperCase ( by . getClass ( ) . getSimpleName ( ) ) + ": '" + by . getValue ( ) + "' are not found!" ) ; } else { Assert . fail ( "WebElement with " + webUtils . splitNameByUpperCase ( by . getClass ( ) . getSimpleName ( ) ) + ": '" + by . getValue ( ) + "' is not found!" ) ; } } return webElement ; }
Returns a WebElement matching the specified By object and index .
22,774
public String getWebUrl ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getWebUrl()" ) ; } final WebView webView = waiter . waitForAndGetView ( 0 , WebView . class ) ; if ( webView == null ) Assert . fail ( "WebView is not found!" ) ; instrumentation . runOnMainSync ( new Runnable ( ) { public void run ( ) { webUrl = webView . getUrl ( ) ; } } ) ; return webUrl ; }
Returns the current web page URL .
22,775
public ArrayList < View > getCurrentViews ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getCurrentViews()" ) ; } return viewFetcher . getViews ( null , true ) ; }
Returns an ArrayList of the Views currently displayed in the focused Activity or Dialog .
22,776
public < T extends View > ArrayList < T > getCurrentViews ( Class < T > classToFilterBy , boolean includeSubclasses , View parent ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getCurrentViews(" + classToFilterBy + ", " + includeSubclasses + ", " + parent + ")" ) ; } return viewFetcher . getCurrentViews ( classToFilterBy , includeSubclasses , parent ) ; }
Returns an ArrayList of Views matching the specified class located under the specified parent .
22,777
public ArrayList < WebElement > getWebElements ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getWebElements()" ) ; } return webUtils . getWebElements ( false ) ; }
Returns an ArrayList of all the WebElements displayed in the active WebView .
22,778
public ArrayList < WebElement > getCurrentWebElements ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getCurrentWebElements()" ) ; } return webUtils . getWebElements ( true ) ; }
Returns an ArrayList of the currently displayed WebElements in the active WebView .
22,779
public boolean isRadioButtonChecked ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isRadioButtonChecked(" + index + ")" ) ; } return checker . isButtonChecked ( RadioButton . class , index ) ; }
Checks if a RadioButton matching the specified index is checked .
22,780
public boolean isRadioButtonChecked ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isRadioButtonChecked(\"" + text + "\")" ) ; } return checker . isButtonChecked ( RadioButton . class , text ) ; }
Checks if a RadioButton displaying the specified text is checked .
22,781
public boolean isCheckBoxChecked ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isCheckBoxChecked(" + index + ")" ) ; } return checker . isButtonChecked ( CheckBox . class , index ) ; }
Checks if a CheckBox matching the specified index is checked .
22,782
public boolean isToggleButtonChecked ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isToggleButtonChecked(\"" + text + "\")" ) ; } return checker . isButtonChecked ( ToggleButton . class , text ) ; }
Checks if a ToggleButton displaying the specified text is checked .
22,783
public boolean isToggleButtonChecked ( int index ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isToggleButtonChecked(" + index + ")" ) ; } return checker . isButtonChecked ( ToggleButton . class , index ) ; }
Checks if a ToggleButton matching the specified index is checked .
22,784
public boolean isCheckBoxChecked ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isCheckBoxChecked(\"" + text + "\")" ) ; } return checker . isButtonChecked ( CheckBox . class , text ) ; }
Checks if a CheckBox displaying the specified text is checked .
22,785
@ SuppressWarnings ( "unchecked" ) public boolean isTextChecked ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isTextChecked(\"" + text + "\")" ) ; } waiter . waitForViews ( false , CheckedTextView . class , CompoundButton . class ) ; if ( viewFetcher . getCurrentViews ( CheckedTextView . class , true ) . size ( ) > 0 && checker . isCheckedTextChecked ( text ) ) return true ; if ( viewFetcher . getCurrentViews ( CompoundButton . class , true ) . size ( ) > 0 && checker . isButtonChecked ( CompoundButton . class , text ) ) return true ; return false ; }
Checks if the specified text is checked .
22,786
public boolean isSpinnerTextSelected ( String text ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isSpinnerTextSelected(\"" + text + "\")" ) ; } return checker . isSpinnerTextSelected ( text ) ; }
Checks if the specified text is selected in any Spinner located in the current screen .
22,787
public void hideSoftKeyboard ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "hideSoftKeyboard()" ) ; } dialogUtils . hideSoftKeyboard ( null , true , false ) ; }
Hides the soft keyboard .
22,788
public void unlockScreen ( ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "unlockScreen()" ) ; } final Activity activity = activityUtils . getCurrentActivity ( false ) ; instrumentation . runOnMainSync ( new Runnable ( ) { public void run ( ) { if ( activity != null ) { activity . getWindow ( ) . addFlags ( WindowManager . LayoutParams . FLAG_DISMISS_KEYGUARD ) ; } } } ) ; }
Unlocks the lock screen .
22,789
public void goBackToActivity ( String name ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "goBackToActivity(\"" + name + "\")" ) ; } activityUtils . goBackToActivity ( name ) ; }
Returns to an Activity matching the specified name .
22,790
public boolean waitForActivity ( String name ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForActivity(\"" + name + "\")" ) ; } return waiter . waitForActivity ( name , Timeout . getLargeTimeout ( ) ) ; }
Waits for an Activity matching the specified name . Default timeout is 20 seconds .
22,791
public boolean waitForActivity ( String name , int timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForActivity(\"" + name + "\", " + timeout + ")" ) ; } return waiter . waitForActivity ( name , timeout ) ; }
Waits for an Activity matching the specified name .
22,792
public boolean waitForActivity ( Class < ? extends Activity > activityClass ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForActivity(" + activityClass + ")" ) ; } return waiter . waitForActivity ( activityClass , Timeout . getLargeTimeout ( ) ) ; }
Waits for an Activity matching the specified class . Default timeout is 20 seconds .
22,793
public boolean waitForActivity ( Class < ? extends Activity > activityClass , int timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForActivity(" + activityClass + ", " + timeout + ")" ) ; } return waiter . waitForActivity ( activityClass , timeout ) ; }
Waits for an Activity matching the specified class .
22,794
public boolean waitForEmptyActivityStack ( int timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForEmptyActivityStack(" + timeout + ")" ) ; } return waiter . waitForCondition ( new Condition ( ) { public boolean isSatisfied ( ) { return activityUtils . isActivityStackEmpty ( ) ; } } , timeout ) ; }
Wait for the activity stack to be empty .
22,795
public boolean waitForFragmentByTag ( String tag ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForFragmentByTag(\"" + tag + "\")" ) ; } return waiter . waitForFragment ( tag , 0 , Timeout . getLargeTimeout ( ) ) ; }
Waits for a Fragment matching the specified tag . Default timeout is 20 seconds .
22,796
public boolean waitForFragmentByTag ( String tag , int timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForFragmentByTag(\"" + tag + "\", " + timeout + ")" ) ; } return waiter . waitForFragment ( tag , 0 , timeout ) ; }
Waits for a Fragment matching the specified tag .
22,797
public boolean waitForFragmentById ( int id ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForFragmentById(" + id + ")" ) ; } return waiter . waitForFragment ( null , id , Timeout . getLargeTimeout ( ) ) ; }
Waits for a Fragment matching the specified resource id . Default timeout is 20 seconds .
22,798
public boolean waitForFragmentById ( int id , int timeout ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForFragmentById(" + id + ", " + timeout + ")" ) ; } return waiter . waitForFragment ( null , id , timeout ) ; }
Waits for a Fragment matching the specified resource id .
22,799
public String getString ( int id ) { if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getString(" + id + ")" ) ; } return getter . getString ( id ) ; }
Returns a localized String matching the specified resource id .