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
- Package com.luwenjie.helloworld.test;
- Import Android.test.ActivityInstrumentationTestCase2;
- Import com.luwenjie.helloworld.HelloWorldActivity;
- Import Com.jayway.android.robotium.solo.Solo;
- Public class HelloWorldTest extends ActivityInstrumentationTestCase2
- private solo solo;
- What is the app you need to test?
- Here, we need to test the application of helloworldactivity under the Com.luwenjie.helloworld package.
- Public HelloWorldTest () {
- Super ("Com.luwenjie.helloworld", helloworldactivity. Class);
- }
- Open HelloWorld this app
- public void SetUp () throws exception{
- Solo = new solo (Getinstrumentation (), getactivity ());
- }
- Perform tests
- SearchText (String str): Verifies that a string exists
- public void Testui () throws Exception {
- Boolean expected = true;
- Boolean actual = Solo.searchtext ("Hello") && Solo.searchtext ("World");
- Assertequals ("This and/or is was not found", expected, actual);
- }
- }
Android Test Toolset 02