Android Automated test framework

Source: Internet
Author: User

1, Monkeyrunner: The advantages: The simplest operation, can record the test script, visual operation; Disadvantages: the main generating coordinates of the automated operation, the transplant is not strong, the most limited function;
2, Rubotium: Mainly for an apk for automated testing, APK can have the source code, also can not source code, powerful, the disadvantage is for the apk operation, and need to re-sign the APK (with tools), so the operation is relatively complex;
3, Uiautomator: The advantages: All operations can be automated, easy to operate; Disadvantage: Android version needs to be above 4.0, cannot operate according to the control ID, relative function is more limited, but also enough;
4, Monkey: Accurately speaking, this is not an automated test, because it can only produce random events, can not follow the established steps to operate;
From the above introduction can have this conclusion: Test an APK, you can choose Rubotium, the test process may involve multiple apk, choose Uiautomator; Some simple tests, choose Monkeyrunner;

Hierachyview+monkey

Uiautomator + Monkey

Robotium

Permissions

Root

Ordinary

Ordinary

Whether a signature is required

Is

Whether

Whether

Response speed

10s (user test data)

4s (user test data)

1-2s

Whether to support WebView

Whether

Whether

Is

Whether to support cross-app testing

Is

Is

Whether

Android APIs that support this feature

?

API 16

API 7

Whether the control ID is supported

Is

Whether

Is

From the above data, Android provides testing tools have advantages and disadvantages, some support webview testing, and some do not support. Some support cross-application, some do not support. Therefore, a good Android test tool is more compatible with the above several test methods. For example, Appium.

The Uiautomator TestCase class inherits from the TestCase class of JUnit. The Robotium and espresso inherit from ActivityInstrumentationTestCase2. From this inheritance, we can also understand why the use of Robotium, the application needs to sign. The use of uiautomator is not required. The reason for this is: in a robotium way, the test code is essentially an APK. Depending on the security mechanism of Android, the application needs to be signed.

Android Automated test framework

Related Article

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.