Small knowledge, big challenge! This paper is participating in theEssentials for programmers”Creative activities.
This paper has participated inProject DigginTo win the creative gift package and challenge the creative incentive money.
preface
We know from common methods of APP testing that after a series of testing processes such as UI function test, performance test and compatibility test, a brand new APP will be promoted to APPstore for users to download and use.
In a series of tests for APP, UI function test, which has a particularly large impact on user experience and is the longest time consuming test, takes up one third of the whole test time.
UI functional testing is characterized by high repeatability, which is particularly tedious and boring for manual testing
How can we release our hands, and have tea with a friend of the time, the UI test is over?
This issue, we will introduce to learn several mainstream UI automation testing tools, the outline is as follows, let’s go~
1. UI automation Overview
UI automated testing is an automated testing method that simulates user manual operation of APP UI interface through a series of methods and realizes automatic operation and verification by means of code script.
At the beginning of its popularity, UI automated testing was mainly applied in WEB UI testing. With the rise of mobile devices, THE testing of APP UI in the market is also gradually used.
For UI automation testing framework we are familiar with Appium, Uiautomator and so on
-
Benefits of implementing UI automation
-
Tests of repetitive function
-
Test procedure data is complete
-
Reduce personnel input costs
-
-
UI automatic test application scenario
- Smoke test
- Regression testing
- Dailybuild
- Recurrence probability problem
-
UI automated creation and authoring principles
- Use cases are easy to write and easy to use
- Use cases are easy to maintain
- Underlying framework substitutability
- Failure retry mechanism to improve use case stability
- Log Comprehensive logs facilitate fault locating
- The report is beautifully presented and the test data is complete
-
UI automation framework language
The tools presented in this installment are explained in the Python environment
2. Vysor
Vysor is A window to Your Android, which allows you to quickly view Android devices in real time on PC and operate Android devices with the PC mouse, which is convenient for RD debugging and testing
Vysor features:
- Is a PC remote control of mobile devices of good software
- Timeliness is high
- Supports physical keyboard input of various texts
- A lot of good features are only available in the professional version, need to pay
Vysor website can be downloaded
Installation steps:
-
Download the vysor-win32-ia32.exe installation package
-
Follow the instructions to complete the installation
-
The CMD interface connects to the test device through ADB
-
Open Vysor software to identify test equipment
-
Open the View button and connect the PC to the device. The device screen will be displayed on the PC in real time
-
The PC can use the mouse to perform gesture operations on the device
3. Sikulix
Sikulix is a technology that identifies and controls GUIs for automated testing.
- Running on a Java environment (Java 1.6 or above), using image recognition provided by OpenCV to identify GUI components
- It can run on Windows, MAC, and Linux
Sikulix
The installation steps are as follows:
-
If the JAVA version is not available, you need to install the JDK.
-
After downloading the installation package from the official website, follow instructions to complete the installation
-
View the installation directory. You can view the directory files
-
The sikulix.jar screen is shown below
4. Test the cat
We implemented one in Sikulix to open Netflix and then exit, open the APPStore
douleClick("1634648791298.png")
exists("1634648399855.png")
click("1634648805238.png")
hover("1634649070258.png")
Copy the code
conclusion
In this issue, learn easy to use fully graphical implementation of UI automation scripts, sikulix+ Vysor, for beginners to greatly improve our enthusiasm for UI automation learning.
The UI automation script implemented by Sikulix + Vysor has been found to be quite strict about the LOCATION of the UI
For use in a production environment that is not easy to maintain and transplant, you can use this framework as an automatic learning journey ~
That’s the content of this episode. Please give us your thumbs up and comments. See you next time