Robotium_Android Robotium Solo语法知识(1)

Package 

 Class 

Use 

Tree 

Deprecated 

Index 

Help 

 

 PREV CLASS   NEXT CLASS

FRAMES    NO FRAMES    All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


com.jayway.android.robotium.solo
Class Solo

java.lang.Object

 com.jayway.android.robotium.solo.Solo


public classSolo

extendsObject

This class contains all the methods that the sub-classes have. It supports test cases that span over multiple activities. Robotium has full support for Activities, Dialogs, Toasts, Menus and Context Menus. When writing tests there is no need to plan for or expect new activities in the test case. All is handled automatically by Robotium-Solo. Robotium-Solo can be used in conjunction with ActivityInstrumentationTestCase2. The test cases are written from a user perspective were technical details are not needed. Example of usage (test case spanning over multiple activities):

 

 public void setUp() throws Exception {

 solo = new Solo(getInstrumentation(), getActivity());

 }

 

 public void testTextShows() throws Exception {

 

 solo.clickOnText("Categories");

 solo.clickOnText("Other");

 solo.clickOnButton("Edit");

 solo.searchText("Edit Window");

 solo.clickOnButton("Commit");

 assertTrue(solo.searchText("Changes have been made successfully"));

 }

 

 

Author:

Renas Reda, renas.reda@jayway.com


Field Summary

static int

DELETE
           

static int

DOWN
           

static int

ENTER
           

static int

LANDSCAPE
           

static int

LEFT
           

static int

MENU
           

static int

PORTRAIT
           

static int

RIGHT
           

static int

UP
           

 

Constructor Summary

Solo(android.app.Instrumentation inst, android.app.Activity activity) 
          Constructor that takes in the instrumentation and the start activity.

 

 

Method Summary

 void

assertCurrentActivity(String message,Class expectedClass)
          Asserts that the expected Activity is the currently active one.

 void

assertCurrentActivity(String message,Class expectedClass, boolean isNewInstance) 
          Asserts that the expected Activity is the currently active one, with the possibility to verify that the expected Activity is a new instance of the Activity.

 void

assertCurrentActivity(String message,String name) 
          Asserts that the expected Activity is the currently active one.

 void

assertCurrentActivity(String message,String name, boolean isNewInstance) 
          Asserts that the expected Activity is the currently active one, with the possibility to verify that the expected Activity is a new instance of the Activity.

 void

assertMemoryNotLow()
          Asserts that the available memory in the system is not low.

 void

clearEditText(android.widget.EditText editText)
          Clears the value of an EditText.

 void

clearEditText(int index)
          Clears the value of an EditText.

 ArrayList<android.widget.TextView>

clickInList(int line)
          Clicks on a given list line and returns an ArrayList of the TextView objects that the list line is showing.

 ArrayList<android.widget.TextView>

clickInList(int line, int index) 
          Clicks on a given list line on a specified list and returns an ArrayList of the TextView objects that the list line is showing.

 void

clickLongOnScreen(float x, float y) 
          Long clicks a given coordinate on the screen.

 void

clickLongOnScreen(float x, float y, int time) 
          Long clicks a given coordinate on the screen for a given amount of time.

 void

clickLongOnText(String text)
          Long clicks on a given View.

 void

clickLongOnText(String text, int match) 
          Long clicks on a given View.

 void

clickLongOnText(String text, int match, boolean scroll) 
          Long clicks on a given View.

 void

clickLongOnText(String text, int match, int time) 
          Long clicks on a given View.

 void

clickLongOnTextAndPress(String text, int index) 
          Long clicks on a given View and then selects an item from the context menu that appears.

 void

clickLongOnView(android.view.View view)
          Long clicks on a given View.

 void

clickLongOnView(android.view.View view, int time) 
          Long clicks on a given View for a given amount of time.

 void

clickOnButton(int index)
          Clicks on a Button with a given index.

 void

clickOnButton(String name)
          Clicks on a Button with a given text.

 void

clickOnCheckBox(int index)
          Clicks on a CheckBox with a given index.

 void

clickOnEditText(int index)
          Clicks on an EditText with a given index.

 void

clickOnImage(int index)
          Clicks on an ImageView with a given index.

 void

clickOnImageButton(int index)
          Clicks on an ImageButton with a given index.

 void

clickOnMenuItem(String text)
          Clicks on a MenuItem with a given text.

 void

clickOnMenuItem(String text, boolean subMenu) 
          Clicks on a MenuItem with a given text.

 void

clickOnRadioButton(int index)
          Clicks on a RadioButton with a given index.

 void

clickOnScreen(float x, float y) 
          Clicks on a given coordinate on the screen.

 void

clickOnText(String text)
          Clicks on a View displaying a given text.

 void

clickOnText(String text, int match) 
          Clicks on a View displaying a given text.

 void

clickOnText(String text, int match, boolean scroll) 
          Clicks on a View displaying a given text.

 void

clickOnToggleButton(String name)
          Clicks on a ToggleButton with a given text.

 void

clickOnView(android.view.View view)
          Clicks on a given View.

 void

drag(float fromX, float toX, float fromY, float toY, int stepCount) 
          Simulate touching a given location and dragging it to a new location.

 void

enterText(android.widget.EditText editText,String text) 
          Enters text into a given EditText.

 void

enterText(int index,String text) 
          Enters text into an EditText with a given index.

 void

finalize()
          All activites that have been active are finished.

 ArrayList<android.app.Activity>

getAllOpenedActivities()
          Returns an ArrayList of all the opened/active activities.

 android.widget.Button

getButton(int index)
          Returns a Button with a given index.

 android.widget.Button

getButton(String text)
          Returns a Button which shows a given text.

 android.app.Activity

getCurrentActivity()
          Returns the current Activity.

 ArrayList<android.widget.Button>

getCurrentButtons()
          Returns an ArrayList of the Button objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.CheckBox>

getCurrentCheckBoxes()
          Returns an ArrayList of the CheckBox objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.DatePicker>

getCurrentDatePickers()
          Returns an ArrayList of the DatePicker objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.EditText>

getCurrentEditTexts()
          Returns an ArrayList of the EditText objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.GridView>

getCurrentGridViews()
          Returns an ArrayList of the GridView objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.ImageButton>

getCurrentImageButtons()
          Returns an ArrayList of the ImageButton objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.ImageView>

getCurrentImageViews()
          Returns an ArrayList of the ImageView objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.ListView>

getCurrentListViews()
          Returns an ArrayList of the ListView objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.ProgressBar>

getCurrentProgressBars()
          Returns an ArrayList of the ProgressBar objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.RadioButton>

getCurrentRadioButtons()
          Returns an ArrayList of the RadioButton objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.ScrollView>

getCurrentScrollViews()
          Returns an ArrayList of the ScrollView objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.Spinner>

getCurrentSpinners()
          Returns an ArrayList of the Spinner objects (drop-down menus) currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.TextView>

getCurrentTextViews(android.view.View parent)
          Returns an ArrayList of the TextView objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.TimePicker>

getCurrentTimePickers()
          Returns an ArrayList of the TimePicker objects currently shown in the focused Activity or Dialog.

 ArrayList<android.widget.ToggleButton>

getCurrentToggleButtons()
          Returns an ArrayList of the ToggleButton objects currently shown in the focused Activity or Dialog.

 ArrayList<android.view.View>

getCurrentViews()
          Returns an ArrayList of the View objects currently shown in the focused Activity or Dialog.

 android.widget.EditText

getEditText(int index)
          Returns an EditText with a given index.

 android.widget.EditText

getEditText(String text)
          Returns an EditText which shows a given text.

 android.widget.ImageView

getImage(int index)
          Returns an ImageView with a given index.

 android.widget.ImageButton

getImageButton(int index)
          Returns an ImageButton with a given index.

 String

getString(int resId)
          Returns a localized string.

 android.widget.TextView

getText(int index)
          Returns a TextView with a given index.

 android.widget.TextView

getText(String text)
          Returns a TextView which shows a given text.

 android.view.View

getTopParent(android.view.View view)
          Returns the absolute top parent View for a given View.

 android.view.View

getView(int id)
          Returns a View with a given id.

 ArrayList<android.view.View>

getViews()
          Returns an ArrayList of all the View objects located in the focused Activity or Dialog.

 ArrayList<android.view.View>

getViews(android.view.View parent)
          Returns an ArrayList of the View objects contained in the parent View.

 void

goBack()
          Simulates pressing the hardware back key.

 void

goBackToActivity(String name)
          Returns to the given Activity.

 boolean

isCheckBoxChecked(int index)
          Checks if a CheckBox with a given index is checked.

 boolean

isCheckBoxChecked(String text)
          Checks if a CheckBox with a given text is checked.

 boolean

isRadioButtonChecked(int index)
          Checks if a RadioButton with a given index is checked.

 boolean

isRadioButtonChecked(String text)
          Checks if a RadioButton with a given text is checked.

 boolean

isSpinnerTextSelected(int index,String text) 
          Checks if a given text is selected in a given Spinner.

 boolean

isSpinnerTextSelected(String text)
          Checks if a given text is selected in any Spinner located in the current screen.

 boolean

isTextChecked(String text)
          Checks if the given text is checked.

 boolean

isToggleButtonChecked(int index)
          Checks if a ToggleButton with a given index is checked.

 boolean

isToggleButtonChecked(String text)
          Checks if a ToggleButton with a given text is checked.

 void

pressMenuItem(int index)
          Presses a MenuItem with a given index.

 void

pressMenuItem(int index, int itemsPerRow) 
          Presses a MenuItem with a given index.

 void

pressSpinnerItem(int spinnerIndex, int itemIndex) 
          Presses on a Spinner (drop-down menu) item.

 boolean

scrollDown()
          Scrolls down the screen.

 boolean

scrollDownList(int index)
          Scrolls down a list with a given index.

 void

scrollToSide(int side)
          Scrolls horizontally.

 boolean

scrollUp()
          Scrolls up the screen.

 boolean

scrollUpList(int index)
          Scrolls up a list with a given index.

 boolean

searchButton(String text)
          Searches for a Button with the given text string and returns true if at least one Button is found.

 boolean

searchButton(String text, boolean onlyVisible) 
          Searches for a Button with the given text string and returns true if at least one Button is found.

 boolean

searchButton(String text, int minimumNumberOfMatches) 
          Searches for a Button with the given text string and returns true if the searched Button is found a given number of times.

 boolean

searchButton(String text, int minimumNumberOfMatches, boolean onlyVisible) 
          Searches for a Button with the given text string and returns true if the searched Button is found a given number of times.

 boolean

searchEditText(String text)
          Searches for a text string in the EditText objects currently shown and returns true if found.

 boolean

searchText(String text)
          Searches for a text string and returns true if at least one item is found with the expected text.

 boolean

searchText(String text, boolean onlyVisible) 
          Searches for a text string and returns true if at least one item is found with the expected text.

 boolean

searchText(String text, int minimumNumberOfMatches) 
          Searches for a text string and returns true if the searched text is found a given number of times.

 boolean

searchText(String text, int minimumNumberOfMatches, boolean scroll) 
          Searches for a text string and returns true if the searched text is found a given number of times.

 boolean

searchText(String text, int minimumNumberOfMatches, boolean scroll, boolean onlyVisible) 
          Searches for a text string and returns true if the searched text is found a given number of times.

 boolean

searchToggleButton(String text)
          Searches for a ToggleButton with the given text string and returns true if at least one ToggleButton is found.

 boolean

searchToggleButton(String text, int minimumNumberOfMatches) 
          Searches for a ToggleButton with the given text string and returns true if the searched ToggleButton is found a given number of times.

 void

sendKey(int key)
          Sends a key: Right, Left, Up, Down, Enter, Menu or Delete.

 void

setActivityOrientation(int orientation)
          Sets the Orientation (Landscape/Portrait) for the current activity.

 void

setDatePicker(android.widget.DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) 
          Sets the date in a given DatePicker.

 void

setDatePicker(int index, int year, int monthOfYear, int dayOfMonth) 
          Sets the date in a DatePicker with a given index.

 void

setProgressBar(int index, int progress) 
          Sets the progress of a ProgressBar with a given index.

 void

setProgressBar(android.widget.ProgressBar progressBar, int progress) 
          Sets the progress of a given ProgressBar.

 void

setTimePicker(int index, int hour, int minute) 
          Sets the time in a TimePicker with a given index.

 void

setTimePicker(android.widget.TimePicker timePicker, int hour, int minute) 
          Sets the time in a given TimePicker.

 void

sleep(int time)
          Robotium will sleep for a specified time.

 boolean

waitForActivity(String name, int timeout) 
          Waits for the given Activity.

 boolean

waitForDialogToClose(long timeout)
          Waits for a Dialog to close.

 boolean

waitForText(String text)
          Waits for a text to be shown.

 boolean

waitForText(String text, int minimumNumberOfMatches, long timeout) 
          Waits for a text to be shown.

 boolean

waitForText(String text, int minimumNumberOfMatches, long timeout, boolean scroll) 
          Waits for a text to be shown.

<T extends android.view.View>
boolean

waitForView(Class<T> viewClass)
          Waits for a View to be shown.

<T extends android.view.View>
boolean

waitForView(Class<T> viewClass, int minimumNumberOfMatches, int timeout) 
          Waits for a View to be shown.

<T extends android.view.View>
boolean

waitForView(Class<T> viewClass, int minimumNumberOfMatches, int timeout, boolean scroll) 
          Waits for a View to be shown.

 

Methods inherited from class java.lang.Object

clone,equalsgetClasshashCodenotifynotifyAlltoStringwaitwaitwait

 

Field Detail

LANDSCAPE

public static final intLANDSCAPE

See Also:

Constant Field Values


PORTRAIT

public static final intPORTRAIT

See Also:

Constant Field Values


RIGHT

public static final intRIGHT

See Also:

Constant Field Values


LEFT

public static final intLEFT

See Also:

Constant Field Values


UP

public static final intUP

See Also:

Constant Field Values


DOWN

public static final intDOWN

See Also:

Constant Field Values


ENTER

public static final intENTER

See Also:

Constant Field Values


MENU

public static final intMENU

See Also:

Constant Field Values


DELETE

public static final intDELETE

See Also:

Constant Field Values

Constructor Detail

Solo

publicSolo(android.app.Instrumentation inst,

           android.app.Activity activity)

Constructor that takes in the instrumentation and the start activity.

Parameters:

inst - the Instrumentation instance

activity - the start Activity

Method Detail

getViews

publicArrayList<android.view.View> getViews()

Returns an ArrayList of all the View objects located in the focused Activity or Dialog.

Returns:

an ArrayList of the View objects located in the focused window


getViews

publicArrayList<android.view.View> getViews(android.view.View parent)

Returns an ArrayList of the View objects contained in the parent View.

Parameters:

parent - the parent view from which to return the views

Returns:

an ArrayList of the View objects contained in the given View


getTopParent

public android.view.ViewgetTopParent(android.view.View view)

Returns the absolute top parent View for a given View.

Parameters:

view - the View whose top parent is requested

Returns:

the top parent View


clearEditText

public voidclearEditText(int index)

Clears the value of an EditText.

Parameters:

index - the index of the EditText that should be cleared. 0 if only one is available


clearEditText

public voidclearEditText(android.widget.EditText editText)

Clears the value of an EditText.

Parameters:

editText - the EditText that should be cleared


waitForText

public booleanwaitForText(String text)

Waits for a text to be shown. Default timeout is 20 seconds.

Parameters:

text - the text to wait for

Returns:

true if text is shown and false if it is not shown before the timeout


waitForText

public booleanwaitForText(String text,

                          int minimumNumberOfMatches,

                          long timeout)

Waits for a text to be shown.

Parameters:

text - the text to wait for

minimumNumberOfMatches - the minimum number of matches that are expected to be shown. 0 means any number of matches

timeout - the the amount of time in milliseconds to wait

Returns:

true if text is shown and false if it is not shown before the timeout


waitForText

public booleanwaitForText(String text,

                          int minimumNumberOfMatches,

                          long timeout,

                          boolean scroll)

Waits for a text to be shown.

Parameters:

text - the text to wait for

minimumNumberOfMatches - the minimum number of matches that are expected to be shown. 0 means any number of matches

timeout - the the amount of time in milliseconds to wait

scroll - true if scrolling should be performed

Returns:

true if text is shown and false if it is not shown before the timeout


waitForView

public <T extends android.view.View> booleanwaitForView(Class<T> viewClass)

Waits for a View to be shown. Default timeout is 20 seconds.

Parameters:

viewClass - the View class to wait for


waitForView

public <T extends android.view.View> booleanwaitForView(Class<T> viewClass,

                                                        int minimumNumberOfMatches,

                                                        int timeout)

Waits for a View to be shown.

Parameters:

viewClass - the View class to wait for

minimumNumberOfMatches - the minimum number of matches that are expected to be shown. 0 means any number of matches

timeout - the amount of time in milliseconds to wait

Returns:

true if view is shown and false if it is not shown before the timeout


waitForView

public <T extends android.view.View> booleanwaitForView(Class<T> viewClass,

                                                        int minimumNumberOfMatches,

                                                        int timeout,

                                                        boolean scroll)

Waits for a View to be shown.

Parameters:

viewClass - the View class to wait for

minimumNumberOfMatches - the minimum number of matches that are expected to be shown. 0 means any number of matches

timeout - the amount of time in milliseconds to wait

scroll - true if scrolling should be performed

Returns:

true if the View is shown and false if it is not shown before the timeout


searchEditText

public booleansearchEditText(String text)

Searches for a text string in the EditText objects currently shown and returns true if found. Will automatically scroll when needed.

Parameters:

text - the text to search for

Returns:

true if an EditText with the given text is found or false if it is not found


searchButton

public booleansearchButton(String text)

Searches for a Button with the given text string and returns true if at least one Button is found. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

Returns:

true if a Button with the given text is found and false if it is not found


searchButton

public booleansearchButton(String text,

                           boolean onlyVisible)

Searches for a Button with the given text string and returns true if at least one Button is found. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

onlyVisible - true if only Button visible on the screen should be searched

Returns:

true if a Button with the given text is found and false if it is not found


searchToggleButton

public booleansearchToggleButton(String text)

Searches for a ToggleButton with the given text string and returns true if at least one ToggleButton is found. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

Returns:

true if a ToggleButton with the given text is found and false if it is not found


searchButton

public booleansearchButton(String text,

                           int minimumNumberOfMatches)

Searches for a Button with the given text string and returns true if the searched Button is found a given number of times. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found

Returns:

true if a Button with the given text is found a given number of times and false if it is not found


searchButton

public booleansearchButton(String text,

                           int minimumNumberOfMatches,

                           boolean onlyVisible)

Searches for a Button with the given text string and returns true if the searched Button is found a given number of times. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found

onlyVisible - true if only Button visible on the screen should be searched

Returns:

true if a Button with the given text is found a given number of times and false if it is not found


searchToggleButton

public booleansearchToggleButton(String text,

                                 int minimumNumberOfMatches)

Searches for a ToggleButton with the given text string and returns true if the searched ToggleButton is found a given number of times. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found

Returns:

true if a ToggleButton with the given text is found a given number of times and false if it is not found


searchText

public booleansearchText(String text)

Searches for a text string and returns true if at least one item is found with the expected text. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

Returns:

true if the search string is found and false if it is not found


searchText

public booleansearchText(String text,

                         boolean onlyVisible)

Searches for a text string and returns true if at least one item is found with the expected text. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

onlyVisible - true if only texts visible on the screen should be searched

Returns:

true if the search string is found and false if it is not found


searchText

public booleansearchText(String text,

                         int minimumNumberOfMatches)

Searches for a text string and returns true if the searched text is found a given number of times. Will automatically scroll when needed.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression

minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found

Returns:

true if text string is found a given number of times and false if the text string is not found


searchText

public booleansearchText(String text,

                         int minimumNumberOfMatches,

                         boolean scroll)

Searches for a text string and returns true if the searched text is found a given number of times.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression.

minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found

scroll - true if scrolling should be performed

Returns:

true if text string is found a given number of times and false if the text string is not found


searchText

public booleansearchText(String text,

                         int minimumNumberOfMatches,

                         boolean scroll,

                         boolean onlyVisible)

Searches for a text string and returns true if the searched text is found a given number of times.

Parameters:

text - the text to search for. The parameter will be interpreted as a regular expression.

minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found

scroll - true if scrolling should be performed

onlyVisible - true if only texts visible on the screen should be searched

Returns:

true if text string is found a given number of times and false if the text string is not found


setActivityOrientation

public voidsetActivityOrientation(int orientation)

Sets the Orientation (Landscape/Portrait) for the current activity.

Parameters:

orientation - the orientation to be set. Solo.LANDSCAPE for landscape or Solo.PORTRAIT for portrait.


getAllOpenedActivities

publicArrayList<android.app.Activity> getAllOpenedActivities()

Returns an ArrayList of all the opened/active activities.

Returns:

an ArrayList of all the opened/active activities


getCurrentActivity

public android.app.ActivitygetCurrentActivity()

Returns the current Activity.

Returns:

the current Activity


assertCurrentActivity

public voidassertCurrentActivity(String message,

                                 String name)

Asserts that the expected Activity is the currently active one.

Parameters:

message - the message that should be displayed if the assert fails

name - the name of the Activity that is expected to be active e.g. "MyActivity"


assertCurrentActivity

public voidassertCurrentActivity(String message,

                                 Class expectedClass)

Asserts that the expected Activity is the currently active one.

Parameters:

message - the message that should be displayed if the assert fails

expectedClass - the Class object that is expected to be active e.g. MyActivity.class


assertCurrentActivity

public voidassertCurrentActivity(String message,

                                 String name,

                                 boolean isNewInstance)

Asserts that the expected Activity is the currently active one, with the possibility to verify that the expected Activity is a new instance of the Activity.

Parameters:

message - the message that should be displayed if the assert fails

name - the name of the activity that is expected to be active e.g. "MyActivity"

isNewInstance - true if the expected Activity is a new instance of the Activity


assertCurrentActivity

public voidassertCurrentActivity(String message,

                                 Class expectedClass,

                                 boolean isNewInstance)

Asserts that the expected Activity is the currently active one, with the possibility to verify that the expected Activity is a new instance of the Activity.

Parameters:

message - the message that should be displayed if the assert fails

expectedClass - the Class object that is expected to be active e.g. MyActivity.class

isNewInstance - true if the expected Activity is a new instance of the Activity


assertMemoryNotLow

public voidassertMemoryNotLow()

Asserts that the available memory in the system is not low.


waitForDialogToClose

public booleanwaitForDialogToClose(long timeout)

Waits for a Dialog to close.

Parameters:

timeout - the amount of time in milliseconds to wait

Returns:

true if the Dialog is closed before the timeout and false if it is not closed


goBack

public voidgoBack()

Simulates pressing the hardware back key.


clickOnScreen

public voidclickOnScreen(float x,

                         float y)

Clicks on a given coordinate on the screen.

Parameters:

x - the x coordinate

y - the y coordinate


clickLongOnScreen

public voidclickLongOnScreen(float x,

                             float y)

Long clicks a given coordinate on the screen.

Parameters:

x - the x coordinate

y - the y coordinate


clickLongOnScreen

public voidclickLongOnScreen(float x,

                             float y,

                             int time)

Long clicks a given coordinate on the screen for a given amount of time.

Parameters:

x - the x coordinate

y - the y coordinate

time - the amount of time to long click


clickOnButton

public voidclickOnButton(String name)

Clicks on a Button with a given text. Will automatically scroll when needed.

Parameters:

name - the name of the Button presented to the user. The parameter will be interpreted as a regular expression


clickOnImageButton

public voidclickOnImageButton(int index)

Clicks on an ImageButton with a given index.

Parameters:

index - the index of the ImageButton to be clicked. 0 if only one is available


clickOnToggleButton

public voidclickOnToggleButton(String name)

Clicks on a ToggleButton with a given text.

Parameters:

name - the name of the ToggleButton presented to the user. The parameter will be interpreted as a regular expression


clickOnMenuItem

public voidclickOnMenuItem(String text)

Clicks on a MenuItem with a given text.

Parameters:

text - the menu text that should be clicked on. The parameter will be interpreted as a regular expression


clickOnMenuItem

public voidclickOnMenuItem(String text,

                           boolean subMenu)

Clicks on a MenuItem with a given text.

Parameters:

text - the menu text that should be clicked on. The parameter will be interpreted as a regular expression

subMenu - true if the menu item could be located in a sub menu


pressMenuItem

public voidpressMenuItem(int index)

Presses a MenuItem with a given index. Index 0 is the first item in the first row, Index 3 is the first item in the second row and index 6 is the first item in the third row.

Parameters:

index - the index of the MenuItem to be pressed


pressMenuItem

public voidpressMenuItem(int index,

                         int itemsPerRow)

Presses a MenuItem with a given index. Supports three rows with a given amount of items. If itemsPerRow equals 5 then index 0 is the first item in the first row, index 5 is the first item in the second row and index 10 is the first item in the third row.

Parameters:

index - the index of the MenuItem to be pressed

itemsPerRow - the amount of menu items there are per row.


pressSpinnerItem

public voidpressSpinnerItem(int spinnerIndex,

                            int itemIndex)

Presses on a Spinner (drop-down menu) item.

Parameters:

spinnerIndex - the index of the Spinner menu to be used

itemIndex - the index of the Spinner item to be pressed relative to the currently selected item A Negative number moves up on the Spinner, positive moves down


clickOnView

public voidclickOnView(android.view.View view)

Clicks on a given View.

Parameters:

view - the View that should be clicked


clickLongOnView

public voidclickLongOnView(android.view.View view)

Long clicks on a given View.

Parameters:

view - the View that should be long clicked


clickLongOnView

public voidclickLongOnView(android.view.View view,

                           int time)

Long clicks on a given View for a given amount of time.

Parameters:

view - the View that should be long clicked

time - the amount of time to long click


clickOnText

public voidclickOnText(String text)

Clicks on a View displaying a given text. Will automatically scroll when needed.

Parameters:

text - the text that should be clicked. The parameter will be interpreted as a regular expression


clickOnText

public voidclickOnText(String text,

                       int match)

Clicks on a View displaying a given text. Will automatically scroll when needed.

Parameters:

text - the text that should be clicked. The parameter will be interpreted as a regular expression

match - the match of the text that should be clicked


clickOnText

public voidclickOnText(String text,

                       int match,

                       boolean scroll)

Clicks on a View displaying a given text.

Parameters:

text - the text that should be clicked on. The parameter will be interpreted as a regular expression

match - the match of the text that should be clicked

scroll - true if scrolling should be performed


clickLongOnText

public voidclickLongOnText(String text)

Long clicks on a given View. Will automatically scroll when needed.clickOnText(String) can then be used to click on the context menu items that appear after the long click.

Parameters:

text - the text that should be clicked. The parameter will be interpreted as a regular expression


clickLongOnText

public voidclickLongOnText(String text,

                           int match)

Long clicks on a given View. Will automatically scroll when needed.clickOnText(String) can then be used to click on the context menu items that appear after the long click.

Parameters:

text - the text that should be clicked. The parameter will be interpreted as a regular expression

match - the match of the text that should be clicked


clickLongOnText

public voidclickLongOnText(String text,

                           int match,

                           boolean scroll)

Long clicks on a given View.clickOnText(String) can then be used to click on the context menu items that appear after the long click.

Parameters:

text - the text that should be clicked. The parameter will be interpreted as a regular expression

match - the match of the text that should be clicked

scroll - true if scrolling should be performed


clickLongOnText

public voidclickLongOnText(String text,

                           int match,

                           int time)

Long clicks on a given View.clickOnText(String) can then be used to click on the context menu items that appear after the long click.

Parameters:

text - the text that should be clicked. The parameter will be interpreted as a regular expression

match - the match of the text that should be clicked

time - the amount of time to long click


clickLongOnTextAndPress

public voidclickLongOnTextAndPress(String text,

                                   int index)

Long clicks on a given View and then selects an item from the context menu that appears. Will automatically scroll when needed.

Parameters:

text - the text to be clicked. The parameter will be interpreted as a regular expression

index - the index of the menu item to be pressed. 0 if only one is available


clickOnButton

public voidclickOnButton(int index)

Clicks on a Button with a given index.

Parameters:

index - the index of the Button to be clicked. 0 if only one is available


clickOnRadioButton

public voidclickOnRadioButton(int index)

Clicks on a RadioButton with a given index.

Parameters:

index - the index of the RadioButton to be clicked. 0 if only one is available


clickOnCheckBox

public voidclickOnCheckBox(int index)

Clicks on a CheckBox with a given index.

Parameters:

index - the index of the CheckBox to be clicked. 0 if only one is available


clickOnEditText

public voidclickOnEditText(int index)

Clicks on an EditText with a given index.

Parameters:

index - the index of the EditText to be clicked. 0 if only one is available


clickInList

publicArrayList<android.widget.TextView> clickInList(int line)

Clicks on a given list line and returns an ArrayList of the TextView objects that the list line is showing. Will use the first list it finds.

Parameters:

line - the line that should be clicked

Returns:

an ArrayList of the TextView objects located in the list line


clickInList

publicArrayList<android.widget.TextView> clickInList(int line,

                                                     int index)

Clicks on a given list line on a specified list and returns an ArrayList of the TextView objects that the list line is showing.

Parameters:

line - the line that should be clicked

index - the index of the list. 1 if two lists are available

Returns:

an ArrayList of the TextView objects located in the list line


drag

public voiddrag(float fromX,

                float toX,

                float fromY,

                float toY,

                int stepCount)

Simulate touching a given location and dragging it to a new location. This method was copied from TouchUtils.java in the Android Open Source Project, and modified here.

Parameters:

fromX - X coordinate of the initial touch, in screen coordinates

toX - X coordinate of the drag destination, in screen coordinates

fromY - X coordinate of the initial touch, in screen coordinates

toY - Y coordinate of the drag destination, in screen coordinates

stepCount - How many move steps to include in the drag


scrollDown

public booleanscrollDown()

Scrolls down the screen.

Returns:

true if more scrolling can be done and false if it is at the end of the screen


scrollUp

public booleanscrollUp()

Scrolls up the screen.

Returns:

true if more scrolling can be done and false if it is at the top of the screen


scrollDownList

public booleanscrollDownList(int index)

Scrolls down a list with a given index.

Parameters:

index - the ListView to be scrolled. 0 if only one list is available

Returns:

true if more scrolling can be done


scrollUpList

public booleanscrollUpList(int index)

Scrolls up a list with a given index.

Parameters:

index - the ListView to be scrolled. 0 if only one list is available

Returns:

true if more scrolling can be done


scrollToSide

public voidscrollToSide(int side)

Scrolls horizontally.

Parameters:

side - the side to which to scroll;RIGHT or LEFT


setDatePicker

public voidsetDatePicker(int index,

                         int year,

                         int monthOfYear,

                         int dayOfMonth)

Sets the date in a DatePicker with a given index.

Parameters:

index - the index of the DatePicker. 0 if only one is available

year - the year e.g. 2011

monthOfYear - the month e.g. 03

dayOfMonth - the day e.g. 10


setDatePicker

public voidsetDatePicker(android.widget.DatePicker datePicker,

                         int year,

                         int monthOfYear,

                         int dayOfMonth)

Sets the date in a given DatePicker.

Parameters:

datePicker - the DatePicker object.

year - the year e.g. 2011

monthOfYear - the month e.g. 03

dayOfMonth - the day e.g. 10


setTimePicker

public voidsetTimePicker(int index,

                         int hour,

                         int minute)

Sets the time in a TimePicker with a given index.

Parameters:

index - the index of the TimePicker. 0 if only one is available

hour - the hour e.g. 15

minute - the minute e.g. 30


setTimePicker

public voidsetTimePicker(android.widget.TimePicker timePicker,

                         int hour,

                         int minute)

Sets the time in a given TimePicker.

Parameters:

timePicker - the TimePicker object.

hour - the hour e.g. 15

minute - the minute e.g. 30


setProgressBar

public voidsetProgressBar(int index,

                          int progress)

Sets the progress of a ProgressBar with a given index. Examples are SeekBar and RatingBar.

Parameters:

index - the index of the ProgressBar

progress - the progress that the ProgressBar should be set to


setProgressBar

public voidsetProgressBar(android.widget.ProgressBar progressBar,

                          int progress)

Sets the progress of a given ProgressBar. Examples are SeekBar and RatingBar.

Parameters:

progressBar - the ProgressBar

progress - the progress that the ProgressBar should be set to


enterText

public voidenterText(int index,

                     String text)

Enters text into an EditText with a given index.

Parameters:

index - the index of the EditText. 0 if only one is available

text - the text string to enter into the EditText field


enterText

public voidenterText(android.widget.EditText editText,

                     String text)

Enters text into a given EditText.

Parameters:

editText - the EditText to enter text into

text - the text string to enter into the EditText field


clickOnImage

public voidclickOnImage(int index)

Clicks on an ImageView with a given index.

Parameters:

index - the index of the ImageView to be clicked. 0 if only one is available


getEditText

public android.widget.EditTextgetEditText(int index)

Returns an EditText with a given index.

Parameters:

index - the index of the EditText. 0 if only one is available

Returns:

the EditText with a specified index or null if index is invalid


getButton

public android.widget.ButtongetButton(int index)

Returns a Button with a given index.

Parameters:

index - the index of the Button. 0 if only one is available

Returns:

the Button with a specified index or null if index is invalid


getText

public android.widget.TextViewgetText(int index)

Returns a TextView with a given index.

Parameters:

index - the index of the TextView. 0 if only one is available

Returns:

the TextView with a specified index or null if index is invalid


getImage

public android.widget.ImageViewgetImage(int index)

Returns an ImageView with a given index.

Parameters:

index - the index of the ImageView. 0 if only one is available

Returns:

the ImageView with a specified index or null if index is invalid


getImageButton

public android.widget.ImageButtongetImageButton(int index)

Returns an ImageButton with a given index.

Parameters:

index - the index of the ImageButton. 0 if only one is available

Returns:

the ImageButton with a specified index or null if index is invalid


getText

public android.widget.TextViewgetText(String text)

Returns a TextView which shows a given text.

Parameters:

text - the text that is shown

Returns:

the TextView that shows the given text


getButton

public android.widget.ButtongetButton(String text)

Returns a Button which shows a given text.

Parameters:

text - the text that is shown

Returns:

the Button that shows the given text


getEditText

public android.widget.EditTextgetEditText(String text)

Returns an EditText which shows a given text.

Parameters:

text - the text that is shown

Returns:

the EditText which shows the given text


getView

public android.view.ViewgetView(int id)

Returns a View with a given id.

Parameters:

id - the R.id of the View to be returned

Returns:

a View with a given id


getCurrentViews

publicArrayList<android.view.View> getCurrentViews()

Returns an ArrayList of the View objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the View objects currently shown in the focused window


getCurrentImageViews

publicArrayList<android.widget.ImageView> getCurrentImageViews()

Returns an ArrayList of the ImageView objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the ImageView objects currently shown in the focused window


getCurrentEditTexts

publicArrayList<android.widget.EditText> getCurrentEditTexts()

Returns an ArrayList of the EditText objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the EditText objects currently shown in the focused window


getCurrentListViews

publicArrayList<android.widget.ListView> getCurrentListViews()

Returns an ArrayList of the ListView objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the ListView objects currently shown in the focused window


getCurrentScrollViews

publicArrayList<android.widget.ScrollView> getCurrentScrollViews()

Returns an ArrayList of the ScrollView objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the ScrollView objects currently shown in the focused window


getCurrentSpinners

publicArrayList<android.widget.Spinner> getCurrentSpinners()

Returns an ArrayList of the Spinner objects (drop-down menus) currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the Spinner objects (drop-down menus) currently shown in the focused window


getCurrentTextViews

publicArrayList<android.widget.TextView>getCurrentTextViews(android.view.View parent)

Returns an ArrayList of the TextView objects currently shown in the focused Activity or Dialog.

Parameters:

parent - the parent View from which the TextView objects should be returned. null if all TextView objects from the currently focused window e.g. Activity should be returned

Returns:

an ArrayList of the TextView objects currently shown in the focused window


getCurrentGridViews

publicArrayList<android.widget.GridView> getCurrentGridViews()

Returns an ArrayList of the GridView objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the GridView objects currently shown in the focused window


getCurrentButtons

publicArrayList<android.widget.Button> getCurrentButtons()

Returns an ArrayList of the Button objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the Button objects currently shown in the focused window


getCurrentToggleButtons

publicArrayList<android.widget.ToggleButton> getCurrentToggleButtons()

Returns an ArrayList of the ToggleButton objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the ToggleButton objects currently shown in the focused window


getCurrentRadioButtons

publicArrayList<android.widget.RadioButton> getCurrentRadioButtons()

Returns an ArrayList of the RadioButton objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the RadioButton objects currently shown in the focused window


getCurrentCheckBoxes

publicArrayList<android.widget.CheckBox> getCurrentCheckBoxes()

Returns an ArrayList of the CheckBox objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the CheckBox objects currently shown in the focused window


getCurrentImageButtons

publicArrayList<android.widget.ImageButton> getCurrentImageButtons()

Returns an ArrayList of the ImageButton objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the ImageButton objects currently shown in the focused window


getCurrentDatePickers

publicArrayList<android.widget.DatePicker> getCurrentDatePickers()

Returns an ArrayList of the DatePicker objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the DatePicker objects currently shown in the focused window


getCurrentTimePickers

publicArrayList<android.widget.TimePicker> getCurrentTimePickers()

Returns an ArrayList of the TimePicker objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the TimePicker objects currently shown in the focused window


getCurrentProgressBars

publicArrayList<android.widget.ProgressBar> getCurrentProgressBars()

Returns an ArrayList of the ProgressBar objects currently shown in the focused Activity or Dialog.

Returns:

an ArrayList of the ProgressBar objects currently shown in the focused window


isRadioButtonChecked

public booleanisRadioButtonChecked(int index)

Checks if a RadioButton with a given index is checked.

Parameters:

index - of the RadioButton to check. 0 if only one is available

Returns:

true if RadioButton is checked and false if it is not checked


isRadioButtonChecked

public booleanisRadioButtonChecked(String text)

Checks if a RadioButton with a given text is checked.

Parameters:

text - the text that the RadioButton shows

Returns:

true if a RadioButton with the given text is checked and false if it is not checked


isCheckBoxChecked

public booleanisCheckBoxChecked(int index)

Checks if a CheckBox with a given index is checked.

Parameters:

index - of the CheckBox to check. 0 if only one is available

Returns:

true if CheckBox is checked and false if it is not checked


isToggleButtonChecked

public booleanisToggleButtonChecked(String text)

Checks if a ToggleButton with a given text is checked.

Parameters:

text - the text that the ToggleButton shows

Returns:

true if a ToggleButton with the given text is checked and false if it is not checked


isToggleButtonChecked

public booleanisToggleButtonChecked(int index)

Checks if a ToggleButton with a given index is checked.

Parameters:

index - of the ToggleButton to check. 0 if only one is available

Returns:

true if ToggleButton is checked and false if it is not checked


isCheckBoxChecked

public booleanisCheckBoxChecked(String text)

Checks if a CheckBox with a given text is checked.

Parameters:

text - the text that the CheckBox shows

Returns:

true if a CheckBox with the given text is checked and false if it is not checked


isTextChecked

public booleanisTextChecked(String text)

Checks if the given text is checked.

Parameters:

text - the text that the CheckedTextView or CompoundButton objects show

Returns:

true if the given text is checked and false if it is not checked


isSpinnerTextSelected

public booleanisSpinnerTextSelected(String text)

Checks if a given text is selected in any Spinner located in the current screen.

Parameters:

text - the text that is expected to be selected

Returns:

true if the given text is selected in any Spinner and false if it is not


isSpinnerTextSelected

public booleanisSpinnerTextSelected(int index,

                                    String text)

Checks if a given text is selected in a given Spinner.

Parameters:

index - the index of the spinner to check. 0 if only one spinner is available

text - the text that is expected to be selected

Returns:

true if the given text is selected in the given Spinner and false if it is not


sendKey

public voidsendKey(int key)

Sends a key: Right, Left, Up, Down, Enter, Menu or Delete.

Parameters:

key - the key to be sent. Use Solo.RIGHT,LEFTUPDOWNENTERMENUDELETE


goBackToActivity

public voidgoBackToActivity(String name)

Returns to the given Activity.

Parameters:

name - the name of the Activity to return to, e.g. "MyActivity"


waitForActivity

public booleanwaitForActivity(String name,

                              int timeout)

Waits for the given Activity.

Parameters:

name - the name of the Activity to wait for e.g. "MyActivity"

timeout - the amount of time in milliseconds to wait

Returns:

true if Activity appears before the timeout and false if it does not


getString

publicString getString(int resId)

Returns a localized string.

Parameters:

resId - the resource ID for the string

Returns:

the localized string


sleep

public voidsleep(int time)

Robotium will sleep for a specified time.

Parameters:

time - the time in milliseconds that Robotium should sleep


finalize

public voidfinalize()

             throws Throwable

All activites that have been active are finished.

Overrides:

finalize in classObject

Throws:

Throwable


Package 

 Class 

Use 

Tree 

Deprecated 

Index 

Help 

 

 PREV CLASS   NEXT CLASS

FRAMES    NO FRAMES    All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


Copyright © 2009-2011. All Rights Reserved.

 

 

 


Package 

Class 

Use 

Tree 

Deprecated 

 Index 

Help 

 

 PREV   NEXT

FRAMES    NO FRAMES    All Classes All Classes

   

AC D E F G I L M P R S U W


A

assertCurrentActivity(String, String) - Method in class com.jayway.android.robotium.solo.Solo

Asserts that the expected Activity is the currently active one.

assertCurrentActivity(String, Class) - Method in class com.jayway.android.robotium.solo.Solo

Asserts that the expected Activity is the currently active one.

assertCurrentActivity(String, String, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Asserts that the expected Activity is the currently active one, with the possibility to verify that the expected Activity is a new instance of the Activity.

assertCurrentActivity(String, Class, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Asserts that the expected Activity is the currently active one, with the possibility to verify that the expected Activity is a new instance of the Activity.

assertMemoryNotLow() - Method in class com.jayway.android.robotium.solo.Solo

Asserts that the available memory in the system is not low.


C

clearEditText(int) - Method in class com.jayway.android.robotium.solo.Solo

Clears the value of an EditText.

clearEditText(EditText) - Method in class com.jayway.android.robotium.solo.Solo

Clears the value of an EditText.

clickInList(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a given list line and returns an ArrayList of the TextView objects that the list line is showing.

clickInList(int, int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a given list line on a specified list and returns an ArrayList of the TextView objects that the list line is showing.

clickLongOnScreen(float, float) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks a given coordinate on the screen.

clickLongOnScreen(float, float, int) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks a given coordinate on the screen for a given amount of time.

clickLongOnText(String) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View.

clickLongOnText(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View.

clickLongOnText(String, int, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View.

clickLongOnText(String, int, int) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View.

clickLongOnTextAndPress(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View and then selects an item from the context menu that appears.

clickLongOnView(View) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View.

clickLongOnView(View, int) - Method in class com.jayway.android.robotium.solo.Solo

Long clicks on a given View for a given amount of time.

clickOnButton(String) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a Button with a given text.

clickOnButton(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a Button with a given index.

clickOnCheckBox(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a CheckBox with a given index.

clickOnEditText(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on an EditText with a given index.

clickOnImage(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on an ImageView with a given index.

clickOnImageButton(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on an ImageButton with a given index.

clickOnMenuItem(String) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a MenuItem with a given text.

clickOnMenuItem(String, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a MenuItem with a given text.

clickOnRadioButton(int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a RadioButton with a given index.

clickOnScreen(float, float) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a given coordinate on the screen.

clickOnText(String) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a View displaying a given text.

clickOnText(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a View displaying a given text.

clickOnText(String, int, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a View displaying a given text.

clickOnToggleButton(String) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a ToggleButton with a given text.

clickOnView(View) - Method in class com.jayway.android.robotium.solo.Solo

Clicks on a given View.

com.jayway.android.robotium.solo - package com.jayway.android.robotium.solo

 


D

DELETE - Static variable in class com.jayway.android.robotium.solo.Solo

 

DOWN - Static variable in class com.jayway.android.robotium.solo.Solo

 

drag(float, float, float, float, int) - Method in class com.jayway.android.robotium.solo.Solo

Simulate touching a given location and dragging it to a new location.


E

ENTER - Static variable in class com.jayway.android.robotium.solo.Solo

 

enterText(int, String) - Method in class com.jayway.android.robotium.solo.Solo

Enters text into an EditText with a given index.

enterText(EditText, String) - Method in class com.jayway.android.robotium.solo.Solo

Enters text into a given EditText.


F

finalize() - Method in class com.jayway.android.robotium.solo.Solo

All activites that have been active are finished.


G

getAllOpenedActivities() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of all the opened/active activities.

getButton(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns a Button with a given index.

getButton(String) - Method in class com.jayway.android.robotium.solo.Solo

Returns a Button which shows a given text.

getCurrentActivity() - Method in class com.jayway.android.robotium.solo.Solo

Returns the current Activity.

getCurrentButtons() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the Button objects currently shown in the focused Activity or Dialog.

getCurrentCheckBoxes() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the CheckBox objects currently shown in the focused Activity or Dialog.

getCurrentDatePickers() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the DatePicker objects currently shown in the focused Activity or Dialog.

getCurrentEditTexts() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the EditText objects currently shown in the focused Activity or Dialog.

getCurrentGridViews() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the GridView objects currently shown in the focused Activity or Dialog.

getCurrentImageButtons() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the ImageButton objects currently shown in the focused Activity or Dialog.

getCurrentImageViews() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the ImageView objects currently shown in the focused Activity or Dialog.

getCurrentListViews() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the ListView objects currently shown in the focused Activity or Dialog.

getCurrentProgressBars() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the ProgressBar objects currently shown in the focused Activity or Dialog.

getCurrentRadioButtons() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the RadioButton objects currently shown in the focused Activity or Dialog.

getCurrentScrollViews() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the ScrollView objects currently shown in the focused Activity or Dialog.

getCurrentSpinners() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the Spinner objects (drop-down menus) currently shown in the focused Activity or Dialog.

getCurrentTextViews(View) - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the TextView objects currently shown in the focused Activity or Dialog.

getCurrentTimePickers() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the TimePicker objects currently shown in the focused Activity or Dialog.

getCurrentToggleButtons() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the ToggleButton objects currently shown in the focused Activity or Dialog.

getCurrentViews() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the View objects currently shown in the focused Activity or Dialog.

getEditText(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns an EditText with a given index.

getEditText(String) - Method in class com.jayway.android.robotium.solo.Solo

Returns an EditText which shows a given text.

getImage(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns an ImageView with a given index.

getImageButton(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns an ImageButton with a given index.

getString(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns a localized string.

getText(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns a TextView with a given index.

getText(String) - Method in class com.jayway.android.robotium.solo.Solo

Returns a TextView which shows a given text.

getTopParent(View) - Method in class com.jayway.android.robotium.solo.Solo

Returns the absolute top parent View for a given View.

getView(int) - Method in class com.jayway.android.robotium.solo.Solo

Returns a View with a given id.

getViews() - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of all the View objects located in the focused Activity or Dialog.

getViews(View) - Method in class com.jayway.android.robotium.solo.Solo

Returns an ArrayList of the View objects contained in the parent View.

goBack() - Method in class com.jayway.android.robotium.solo.Solo

Simulates pressing the hardware back key.

goBackToActivity(String) - Method in class com.jayway.android.robotium.solo.Solo

Returns to the given Activity.


I

isCheckBoxChecked(int) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a CheckBox with a given index is checked.

isCheckBoxChecked(String) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a CheckBox with a given text is checked.

isRadioButtonChecked(int) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a RadioButton with a given index is checked.

isRadioButtonChecked(String) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a RadioButton with a given text is checked.

isSpinnerTextSelected(String) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a given text is selected in any Spinner located in the current screen.

isSpinnerTextSelected(int, String) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a given text is selected in a given Spinner.

isTextChecked(String) - Method in class com.jayway.android.robotium.solo.Solo

Checks if the given text is checked.

isToggleButtonChecked(String) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a ToggleButton with a given text is checked.

isToggleButtonChecked(int) - Method in class com.jayway.android.robotium.solo.Solo

Checks if a ToggleButton with a given index is checked.


L

LANDSCAPE - Static variable in class com.jayway.android.robotium.solo.Solo

 

LEFT - Static variable in class com.jayway.android.robotium.solo.Solo

 


M

MENU - Static variable in class com.jayway.android.robotium.solo.Solo

 


P

PORTRAIT - Static variable in class com.jayway.android.robotium.solo.Solo

 

pressMenuItem(int) - Method in class com.jayway.android.robotium.solo.Solo

Presses a MenuItem with a given index.

pressMenuItem(int, int) - Method in class com.jayway.android.robotium.solo.Solo

Presses a MenuItem with a given index.

pressSpinnerItem(int, int) - Method in class com.jayway.android.robotium.solo.Solo

Presses on a Spinner (drop-down menu) item.


R

RIGHT - Static variable in class com.jayway.android.robotium.solo.Solo

 


S

scrollDown() - Method in class com.jayway.android.robotium.solo.Solo

Scrolls down the screen.

scrollDownList(int) - Method in class com.jayway.android.robotium.solo.Solo

Scrolls down a list with a given index.

scrollToSide(int) - Method in class com.jayway.android.robotium.solo.Solo

Scrolls horizontally.

scrollUp() - Method in class com.jayway.android.robotium.solo.Solo

Scrolls up the screen.

scrollUpList(int) - Method in class com.jayway.android.robotium.solo.Solo

Scrolls up a list with a given index.

searchButton(String) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a Button with the given text string and returns true if at least one Button is found.

searchButton(String, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a Button with the given text string and returns true if at least one Button is found.

searchButton(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a Button with the given text string and returns true if the searched Button is found a given number of times.

searchButton(String, int, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a Button with the given text string and returns true if the searched Button is found a given number of times.

searchEditText(String) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a text string in the EditText objects currently shown and returns true if found.

searchText(String) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a text string and returns true if at least one item is found with the expected text.

searchText(String, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a text string and returns true if at least one item is found with the expected text.

searchText(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a text string and returns true if the searched text is found a given number of times.

searchText(String, int, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a text string and returns true if the searched text is found a given number of times.

searchText(String, int, boolean, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a text string and returns true if the searched text is found a given number of times.

searchToggleButton(String) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a ToggleButton with the given text string and returns true if at least one ToggleButton is found.

searchToggleButton(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Searches for a ToggleButton with the given text string and returns true if the searched ToggleButton is found a given number of times.

sendKey(int) - Method in class com.jayway.android.robotium.solo.Solo

Sends a key: Right, Left, Up, Down, Enter, Menu or Delete.

setActivityOrientation(int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the Orientation (Landscape/Portrait) for the current activity.

setDatePicker(int, int, int, int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the date in a DatePicker with a given index.

setDatePicker(DatePicker, int, int, int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the date in a given DatePicker.

setProgressBar(int, int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the progress of a ProgressBar with a given index.

setProgressBar(ProgressBar, int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the progress of a given ProgressBar.

setTimePicker(int, int, int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the time in a TimePicker with a given index.

setTimePicker(TimePicker, int, int) - Method in class com.jayway.android.robotium.solo.Solo

Sets the time in a given TimePicker.

sleep(int) - Method in class com.jayway.android.robotium.solo.Solo

Robotium will sleep for a specified time.

Solo - Class in com.jayway.android.robotium.solo

This class contains all the methods that the sub-classes have.

Solo(Instrumentation, Activity) - Constructor for class com.jayway.android.robotium.solo.Solo

Constructor that takes in the instrumentation and the start activity.


U

UP - Static variable in class com.jayway.android.robotium.solo.Solo

 


W

waitForActivity(String, int) - Method in class com.jayway.android.robotium.solo.Solo

Waits for the given Activity.

waitForDialogToClose(long) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a Dialog to close.

waitForText(String) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a text to be shown.

waitForText(String, int, long) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a text to be shown.

waitForText(String, int, long, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a text to be shown.

waitForView(Class<T>) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a View to be shown.

waitForView(Class<T>, int, int) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a View to be shown.

waitForView(Class<T>, int, int, boolean) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a View to be shown.


AC D E F G I L M P R S U W

Package 

Class 

Use 

Tree 

Deprecated 

 Index 

Help 

 

 PREV   NEXT

FRAMES    NO FRAMES    All Classes All Classes

   

Copyright © 2009-2011. All Rights Reserved.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值