Recommended Instrument Driver for Taobao testing (automated testing for iOS)

Source: Internet
Author: User

Today, I saw the following blog, which is an iOS automated testing tool developed by Taobao testing. It is worth learning and applying:

Instrumentdriver: Yes for iOS automated testing!

Instrumentdriver is a recently implemented automated testing framework for iOS Based on instrument by the Mobile automation team. Currently, it supports writing test cases in Java. Those who have studied IOS automated testing must have heard about instrument UI automation or have used it for automated testing. Since IOS 4.0, Apple officially provided
Ui automation to support automated UI testing of applications. However, version 4.0 does not support the recording function. You can only write JavaScript test scripts based on the provided API documentation. The Instrument Driver script simulates user behavior on the application.

The implementation of instrumentdriver has the following features: 1. Run in C/S mode.The framework is divided into server and client. Both parties send messages through socket communication: the client (mobile) is responsible for requesting the test steps to run and returning the running results; the server (Java case) responds to client requests and accepts the running results of test steps. The implementation of the C/S mode can even write and debug test cases on the PC from the MAC system (the running must be inseparable from the MAC system). In the familiar Window environment, the use case writing is more handy. 2. Test Cases Written in pure Java language are well compatible with APIs in the instrument JS format.Instrumentdriver uses Java to realize the inheritance relationship between each element type and the operation methods provided by each element type. It also extends some easier-to-use operations, such as sliding operations. Testers familiar with the syntax format of instrument JS can quickly use Java to implement test cases.  
3. provides clear control tree structure printing and convenient element search methods.You can print all elements of the current window or all child elements under a certain element in a tree structure. The output attributes include not only the basic attributes (name, value, label, rect, etc.) of each element, but also the guid representing the element, the GUID attribute can be directly used in the use case to perform corresponding operations on the element. Findelemenbytext and related overload methods can easily search for this element based on the display text, type, and index combination of the element, greatly improving the self-descriptive and maintainability of the use case, it also simplifies the compilation of use cases.  

4. debug mode and non-debug mode

Use Cases can be run in both debug mode and non-debug mode. The JSON object or array is transmitted during communication in debug mode. The returned result is instantiated as a specific object. You can debug the script to view the property values of related objects. Non-debug mode only communicates when you need to operate the UI element or obtain the UI element attributes, greatly improving the Running Speed (about twice the debug mode ). This can be thought of as follows: after the debug mode of the use case passes, it can also run in non-debug mode.
5. Run the test case in JUnit mode. instrumentdriver is used to drive the test case in JUnit mode, which has all the advantages of JUnit unit test. It can be better integrated with other tools for continuous integration and data preparation. For example, continuous integration with SVN, Maven, and Hudson and data preparation through itest.
Code and documentation downloads: http://code.taobao.org/p/athrun/src/trunk/iOS/InstrumentDriver/

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.