Comparison of frameworks or tools such as Appium, Robotium, and monkey for Android Testing

Source: Internet
Author: User
Tags appium

1. Appium testing (function testing, user acceptance testing, black box testing)-Rating: 8

 

Appium testing is equivalent to black box testing. Only test the UI logic correctness. Therefore, the Appium testing framework provides limited methods. Obtain an AppiumDriver object. This object only has a lot of findElements() To obtain the UI element. The UI element is a WebElement. This class provides the primary method for obtaining information, such as name, class, tagName, location, text, isSlected, and isTouched. Another click Event generates the function click (). Unfortunately, there is no longClick () event. Only these two useful objects can be operated in the entire test framework. As a whole, this test framework only tests the correctness of the UI logic and cannot be upgraded to the test business logic process. There is no way to detect.

Pros:

  • Open Source
  • You can write test code in different languages.
  • Different platform programs can be tested: Android/iOS/Web/Hybrid
  • Active Community 2. Robotium test (function test, User Acceptance Test, black box + white box test)-Rating: 8

    Web: https://code.google.com/p/robotium/

    Pros:

    • Quite popular for android testing
    • You can test the source code or apk.
    • Android Native and Android Hybrid App can be tested
    • Allows you to test network connections and sounds.
    • Open Source
    • Active Communities and good materials 3. AndroidTest (unit test, logic test, white box test)

      This is detailed description in the https://developer.android.com/tools/testing/index.html SDK. Test various Android components, including ActivityTest, ServiceTest, and ContentProviderTest. It can obtain the resources of each component and inject code for testing.

      1)Activity Testing is mainly used to test the Activity. The main test direction is as follows:

      • Control the lifecycle of an Activity.
      • Dependency injection: Instrumentation allows you to create mock system objects such as Contexts or Applications and use them to run the activity under test. this helps you control the test environment and isolate it from production systems. you can also set up customized Intents and start an activity with them. (The translation is not very good. It is probably said that the simulation object is generated by injection and then the system environment is simulated .)
      • Controls the control elements of the UI and then generates touch events. This function is similar to the description of Appium.

        2)Service Testing tests whether the Service lifecycle is normal.

        3)Content Povider Testiing because provider is a data portal, it tests whether the data can be normally read and written. Test whether all the Uris provided by this provider are normal. Test whether invalid Uris can be intercepted. In general, Android comes with unit testing. Suitable for white box testing. If Android comes with Test, you can obtain more information about the UI or things, and provide more testing methods.

        4. Monkey (stress testing)

        This is a system tool provided by Android. It sends a pseudo-random user event stream (such as key input, touch screen input, and gesture input) to the system to perform stress testing on the application being developed. Monkey testing is a fast and effective method to test the stability and robustness of software.

        • The test object is only an application package and has certain limitations.
        • The event stream data stream used for Monky testing is random and cannot be customized.
        • You can set the MonkeyTest object, event quantity, type, and frequency.

          The SDK provides a detailed description at http://developer.android.com/tools/help/monkey.html. The SDK contains detailed parameter descriptions for testing. This is just a test tool that does not involve encoding.

          5. monkeyRuner (function test, User Acceptance Test, black box test)-Rating: 5

          SDK: http://developer.android.com/tools/help/monkeyrunner_concepts.html this is a test implemented using python encoding. There are three main classes: MonkeyDevice, MonkeyImage, and MonkeyRuner. The most important thing is to provide a key or touch event input value in the program, and then take a screenshot to compare whether the operation is normal. Event API: press (string name, dictionary type) touch (integer x, integer y, integer type) drag (tuple start, tuple end, float duration, integer steps) startActivity (string uri, string action, string data, string mimetype, iterable categories dictionary extras, component, flags) and other events. For details, see API.

          6. UIAutomator-official (black box test, function test)-Rating: 7

          SDK: http://developer.android.com/tools/testing/testing_ui.html

          Pro:

          • You can test the switch between different apps.
          • Official support

            Cons:

            • Only Android native apps can be tested
            • Android SDK 4.1 + is required
            • Unable to get activity of Current load
            • Unable to perform network connection test and sound test
            • Debugging is troublesome.

              The main functions are similar to APPIUM. They mainly include UIDevice, UiObjec, UiSelector, and UiCollection. UIdevice is more Appium-based AppiumDriver analogy. The remaining WebElement analogy is only divided into more details. It is also similar to Appium. Use text, className, and other information to find the UI control and then perform operations.

              7. MonkeyTalk (white box test, function test)

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.