Lao Li share: robotium Common API 1

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.