Before the development of Android automated testing framework, we should first understand the current development situation, know what our goal is, but also to understand the current mainstream framework, to know and learn from each other.
First, consider and understand a few questions:
- What is our goal in developing an automation framework? How to get the framework you want?
- Analysis of advantages and disadvantages of mainstream automation framework at present
- Analysis of source code of mainstream automation framework
- How do I use the framework to develop two times?
This article describes the first of these questions:
One: Android automated test framework goals
- Good stability: Use unique positioning information, such as the ID defined by the developer on the control, to reduce the node judgment by the control index
- Portability: Minimize control judgments and event records through coordinate points, while Monkey and Monkeyrunner are through coordinate information
- Supports cross-application or cross-process interaction: test frameworks Support cross-application, while instrumentation does not support cross-application
- High operating efficiency: window interface jump monitoring and window positioning to be accurate, while Monkey and Monkeyrunner do not support this feature
- Testers easy to get started: The framework is easy to understand and master, test scripts easy to edit, instrumentation and other frameworks for testers have technical requirements
- Easy commissioning: The frame is open enough for easy commissioning
- High development efficiency: high level of package and coverage for app event types
- Controls are easy to capture: high visibility to controls and strong stability
Two: How to get the frame you want
- Match FRAME: Analyze the target application (app), find the feature points and match the current test framework to find the most appropriate
- Framework combination: For large and complex applications, you can compensate for each other's shortcomings by combining different frameworks, achieving high coverage and stability (e.g. Uiautomator and robotium Fusion, covering more events, supporting cross-processes)
- Framework two-time development, encapsulation: two development and encapsulation for some frameworks for improved utilization and stability
- Develop your own tools: develop the appropriate testing tools based on the existing framework principles
Before we proceed to the next two practices, we must have an in-depth understanding of the current testing framework, and the following article will introduce and analyze the current mainstream testing framework.
Android Automated Test Framework Development (i) Overview of the automated testing framework