Robotium Common API
The most important class solo class in Robotium: It provides a way to simulate user activity by clicking, searching, and dragging.
English API (frequent disconnection is not open): HTTP://WWW.JARVANA.COM/JARVANA/VIEW/COM/JAYWAY/ANDROID/ROBOTIUM/ROBOTIUM-SOLO/2.0.1/ Robotium-solo-2.0.1-javadoc.jar!/index-all.html
Chinese API:HTTP://WWW.ROBOTIUM.CN/ARCHIVES/CATEGORY/API/PAGE/7
(Source code parsing-solo:http://www.robotium.cn/archives/1050)
Typical method: (see the above API for more methods and explanations)
Many of these methods operate based on the index value of the control
① Click:
Clickonbutton (int)-clickson a Button
with a givenindex. Click on the button according to the index value.
Clickonbutton (String)-clickson a Button
with a giventext. Click on the button according to the text.
Clickoncheckbox (int)-clickson A with CheckBox
a givenindex.
Clickonview (view)-clickson a given view.
Clickontext (String)-clickson a View
displaying agiven text.
Clicklongontext (String)-longclicks on a given View
.
Clickonradiobutton (int)-clickson A with RadioButton
a givenindex.
Clickonscreen (float, float)-clickson a given coordinate on the screen.
② obtained:
Getcurrentactivity ()-returnsthe current Activity.
GetText (String)-returnsa TextView which shows a given text.
GetView (int)-returnsa View with a given ID.
Getedittext (String)-returnsan EditText which shows a given text.
GetImage (int)-returnsan ImageView with a given index.
③ Drag and drop:
Drag (float, float, float,float, int)-simulate touching a given location anddragging it-a new location.
④ Search:
SearchText (String)-searchesfor a text String and returns true
if at least one item was found with the expected text.
Searchedittext (String)-searchesfor a text String in the EditText objects located in the current Activity.
SearchButton (String, Boolean)-searchesfor a Button with the given text String and returns true if at least one Buttonis fo und.
Lao Li share: robotium Common API 1