android solo,Android Robitium Solo语法知识

com.jayway.android.robotium.soloClass Solo

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

static int

static int

static int

static int

static int

static int

static int

static int

Constructor Summary

(android.app.Instrumentation inst, android.app.Activity activity)

Constructor that takes in the instrumentation and the start activity.

Method Summary

void

(String message,Class expectedClass)

Asserts that the expected Activity is the currently active one.

void

(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

(String message,String name)

Asserts that the expected Activity is the currently active one.

void

(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

()

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

void

(android.widget.EditText editText)

Clears the value of an EditText.

void

(int index)

Clears the value of an EditText.

ArrayList

(int line)

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

ArrayList

(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

(float x, float y)

Long clicks a given coordinate on the screen.

void

(float x, float y, int time)

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

void

(String text)

Long clicks on a given View.

void

(String text, int match)

Long clicks on a given View.

void

(String text, int match, boolean scroll)

Long clicks on a given View.

void

(String text, int match, int time)

Long clicks on a given View.

void

(String text, int index)

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

void

(android.view.View view)

Long clicks on a given View.

void

(android.view.View view, int time)

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

void

(int index)

Clicks on a Button with a given index.

void

(String name)

Clicks on a Button with a given text.

void

(int index)

Clicks on a CheckBox with a given index.

void

(int index)

Clicks on an EditText with a given index.

void

(int index)

Clicks on an ImageView with a given index.

void

(int index)

Clicks on an ImageButton with a given index.

void

(String text)

Clicks on a MenuItem with a given text.

void

(String text, boolean subMenu)

Clicks on a MenuItem with a given text.

void

(int index)

Clicks on a RadioButton with a given index.

void

(float x, float y)

Clicks on a given coordinate on the screen.

void

(String text)

Clicks on a View displaying a given text.

void

(String text, int match)

Clicks on a View displaying a given text.

void

(String text, int match, boolean scroll)

Clicks on a View displaying a given text.

void

(String name)

Clicks on a ToggleButton with a given text.

void

(android.view.View view)

Clicks on a given View.

void

(float fromX, float toX, float fromY, float toY, int stepCount)

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

void

(android.widget.EditText editText,String text)

Enters text into a given EditText.

void

(int index,String text)

Enters text into an EditText with a given index.

void

()

All activites that have been active are finished.

ArrayList

()

Returns an ArrayList of all the opened/active activities.

android.widget.Button

(int index)

Returns a Button with a given index.

android.widget.Button

(String text)

Returns a Button which shows a given text.

android.app.Activity

()

Returns the current Activity.

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

ArrayList

(android.view.View parent)

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

ArrayList

()

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

ArrayList

()

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

ArrayList

()

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

android.widget.EditText

(int index)

Returns an EditText with a given index.

android.widget.EditText

(String text)

Returns an EditText which shows a given text.

android.widget.ImageView

(int index)

Returns an ImageView with a given index.

android.widget.ImageButton

(int index)

Returns an ImageButton with a given index.

(int resId)

Returns a localized string.

android.widget.TextView

(int index)

Returns a TextView with a given index.

android.widget.TextView

(String text)

Returns a TextView which shows a given text.

android.view.View

(android.view.View view)

Returns the absolute top parent View for a given View.

android.view.View

(int id)

Returns a View with a given id.

ArrayList

()

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

ArrayList

(android.view.View parent)

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

void

()

Simulates pressing the hardware back key.

void

(String name)

Returns to the given Activity.

boolean

(int index)

Checks if a CheckBox with a given index is checked.

boolean

(String text)

Checks if a CheckBox with a given text is checked.

boolean

(int index)

Checks if a RadioButton with a given index is checked.

boolean

(String text)

Checks if a RadioButton with a given text is checked.

boolean

(int index,String text)

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

boolean

(String text)

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

boolean

(String text)

Checks if the given text is checked.

boolean

(int index)

Checks if a ToggleButton with a given index is checked.

boolean

(String text)

Checks if a ToggleButton with a given text is checked.

void

(int index)

Presses a MenuItem with a given index.

void

(int index, int itemsPerRow)

Presses a MenuItem with a given index.

void

(int spinnerIndex, int itemIndex)

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

boolean

()

Scrolls down the screen.

boolean

(int index)

Scrolls down a list with a given index.

void

(int side)

Scrolls horizontally.

boolean

()

Scrolls up the screen.

boolean

(int index)

Scrolls up a list with a given index.

boolean

(String text)

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

boolean

(String text, boolean onlyVisible)

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

boolean

(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

(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

(String text)

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

boolean

(String text)

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

boolean

(String text, boolean onlyVisible)

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

boolean

(String text, int minimumNumberOfMatches)

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

boolean

(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

(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

(String text)

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

boolean

(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

(int key)

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

void

(int orientation)

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

void

(android.widget.DatePicker datePicker, int year, int monthOfYear, int dayOfMonth)

Sets the date in a given DatePicker.

void

(int index, int year, int monthOfYear, int dayOfMonth)

Sets the date in a DatePicker with a given index.

void

(int index, int progress)

Sets the progress of a ProgressBar with a given index.

void

(android.widget.ProgressBar progressBar, int progress)

Sets the progress of a given ProgressBar.

void

(int index, int hour, int minute)

Sets the time in a TimePicker with a given index.

void

(android.widget.TimePicker timePicker, int hour, int minute)

Sets the time in a given TimePicker.

void

(int time)

Robotium will sleep for a specified time.

boolean

(String name, int timeout)

Waits for the given Activity.

boolean

(long timeout)

Waits for a Dialog to close.

boolean

(String text)

Waits for a text to be shown.

boolean

(String text, int minimumNumberOfMatches, long timeout)

Waits for a text to be shown.

boolean

(String text, int minimumNumberOfMatches, long timeout, boolean scroll)

Waits for a text to be shown.

boolean

(Class viewClass)

Waits for a View to be shown.

boolean

(Class viewClass, int minimumNumberOfMatches, int timeout)

Waits for a View to be shown.

boolean

(Class viewClass, int minimumNumberOfMatches, int timeout, boolean scroll)

Waits for a View to be shown.

Field Detail

LANDSCAPE

public static final intLANDSCAPE

See Also:

PORTRAIT

public static final intPORTRAIT

See Also:

RIGHT

public static final intRIGHT

See Also:

LEFT

public static final intLEFT

See Also:

UP

public static final intUP

See Also:

DOWN

public static final intDOWN

See Also:

ENTER

public static final intENTER

See Also:

MENU

public static final intMENU

See Also:

DELETE

public static final intDELETE

See Also:

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 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 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 booleanwaitForView(Class viewClass)

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

Parameters:

viewClass - the View class to wait for

waitForView

public booleanwaitForView(Class 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 booleanwaitForView(Class 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 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,

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,

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 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 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,

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,

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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,

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,LEFT, UP, DOWN, ENTER, MENU, DELETE

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()

All activites that have been active are finished.

Overrides:

Throws:

Copyright © 2009-2011. All Rights Reserved.

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.

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) - Method in class com.jayway.android.robotium.solo.Solo

Waits for a View to be shown.

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

Waits for a View to be shown.

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

Waits for a View to be shown.

Copyright © 2009-2011. All Rights Reserved.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值