In the last blog (Mobile Automation Test Framework Introduction and Design) we discussed some basic knowledge about automation framework and how to set up a proper automated testing framework. In this article, I will introduce how to select a suitable automation tool and how to design the framework library.
First, we need to define some important capabilities which we would like to see in an automation tool:
- Can support native view and web view.
- Easily extended, easily maintained, flexible and low-cost.
- Easy to use and Community is active.
Then compare the most popular testing tools based on the above capabilities.
How to choose an automation tool for mobile testing
Appium is obviously the best choice through the comparison in the above table, which is briefly summarized below:
- Appium is a cross-platform tool which supports multiple languages.
- Appium supports Web View and Native View.
- Appium is very extensible. We can integrate it with our favorite test data and report tool.
- Appium is based on the WebDriver API and supports both native and web view. It is very easy for tester engineers to develop test scripts.
- The Appium user community is also active. Any questions about this tool will be answered promptly in the community.
After selecting a suitable mobile automation testing tool, we need to consider how to set up the automation framework based on the selected tool.
Tools list for mobile automation framework
- Mobile automation framework is based on Appium.
- Git is used as a distributed revision control and source code management (SCM) system in this framework.
- Maven is used as the CM tool to configure project dependencies.
- GitLab provides continuous integration services for code development and scheduling test case execution.
- DataBase is used to manage the test data.
- Extent Report is used to manage the test report.
(We will discuss Data Base and Report Management in future blogs)
How to set up a mobile automation framework
Choosing a Global Software Development Partner to Accelerate Your Digital Strategy
To be successful and outpace the competition, you need a software development partner that excels in exactly the type of digital projects you are now faced with accelerating, and in the most cost effective and optimized way possible.
How to design a Framework Library
This framework library is the core of the entire framework. We need to design the library following the architecture which we discussed in the last blog.
The major features in a Framework Library:
- Page Object: Encapsulation of all page elements info into the page object class, which consists of the Element Type Class definition, define page operation functions (business logic).
- TestBase: Base class, initial driver and test engine annotation.
- Element Type Definition: Define an element type, which includes element and other attributes belong to the element.
- TestData Management: Define the communication and procedure with Database.
- Report Management: Define the communication and procedure with Report Listener.
(Put all above features into System Util package)
- Method Encapsulation: this part contains the most useful user actions and verification actions.
(Method encapsulation classes are placed into Function Util package)
Up to this point, the principles of choosing a suitable automated testing framework has been well discussed. Details of designing the framework library to setup the mobile automated testing framework is presented.
My Mobile Automation Framework Blog Series:
Mobile Automation Test Tool Selection and Framework Library Design
Mobile Automation Test Data Management (coming soon)
Mobile Automation Test Report Management (coming soon)