Android Test Toolset 02

Source: Internet
Author: User

User Scenario testing for Android (functional test framework)

Robotium is an Android test automation framework, which has full support for native and hybrid applications. Robotium makes it easy-to-write powerful and robust automatic black-box UI tests for Android applications. With the. Robotium, test case developers can write function, system and user acceptance test scenarios, spanning Multiple Android activities.

See Questions & Answers for common Robotium Questions and Answers.

See Getting Started For instructions and examples in how to create your first robotium tests.

Join the discussions in the Robotium developers Group.

Robotium wiki:http://code.google.com/p/robotium/w/list

Here is an article for Robotium's introduction is very appropriate: Robotium is a package of Android self-instrumentation class, so that testers can directly call the encapsulated interface, that is, in fact, we directly use the instrumentation can also be automated testing, but Robotium can simplify our testing procedures, we only need to call a Robotium API, pass a few parameters, it is equal to our call part of the instrumentation to help us implement the test. Robotium is rich second generation!! Gao!!

http://www.51testing.com/?uid-22381-action-viewspace-itemid-238847

Need to note:

1. Test project: For example: Helloworldtest,build path needs to import Robotium-solo.jar package

2.eclipse:3.7 version, the contents of order and export need to be checked

    1. Package com.luwenjie.helloworld.test;
    2. Import Android.test.ActivityInstrumentationTestCase2;
    3. Import com.luwenjie.helloworld.HelloWorldActivity;
    4. Import Com.jayway.android.robotium.solo.Solo;
    5. Public class HelloWorldTest extends ActivityInstrumentationTestCase2
    6. private solo solo;
    7. What is the app you need to test?
    8. Here, we need to test the application of helloworldactivity under the Com.luwenjie.helloworld package.
    9. Public HelloWorldTest () {
    10. Super ("Com.luwenjie.helloworld", helloworldactivity.  Class);
    11. }
    12. Open HelloWorld this app
    13. public void SetUp () throws exception{
    14. Solo = new solo (Getinstrumentation (), getactivity ());
    15. }
    16. Perform tests
    17. SearchText (String str): Verifies that a string exists
    18. public void Testui () throws Exception {
    19. Boolean expected = true;
    20. Boolean actual = Solo.searchtext ("Hello") && Solo.searchtext ("World");
    21. Assertequals ("This and/or is was not found", expected, actual);
    22. }
    23. }

Android Test Toolset 02

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.