Mobile terminal automated testing

1. Technical options

    Mainly it can be used for mobile automated testing on various platforms. Native Android, ios, and mixed-developed app automated testing such as RN and Flutter are all supported. For other points, please leave them to yourself. Baidu will not go into too much detail. It is mainly based on simplicity of application. host.

2. Concept and process

1. Introduction to the components used 

    1.1. Appium settings: The mobile middleware app used to interact with our test app and appium server data. The app will be automatically installed when the Appium Server GUI link is successfully configured for the first time.

   1.2. Appium Server GUI: A service released on the PC to handle user operations and mobile middleware data interaction (download and installation address: https://github.com/appium/appium-desktop/releases/tag/v1.22.3 -4  )

    1.3. Appium Inspector: Application software that users can operate (script recording, etc.) on the PC (download and installation address: https://github.com/appium/appium-inspector/releases/tag/v2022.9.1  )

    1.4. Install the python environment (download address according to system requirements: Python Releases for Windows | Python.org  installation version. Check the first page to add python to the environment variables and follow the next step to complete)

    1.5. Appium-Python-Client: A script executor used to execute recording scripts on the PC (download and installation address: Appium-Python-Client · PyPI  or command installation pip install Appium-Python-Client)

2. Process and principle

2.1. Script recording process and principle

2.2. Automated script running process and principle

 3. Construction of mobile terminal testing framework

1. jdk installation and configuration (install Graal VM official website download: Download GraalVM ):

1.1. Select the system and version

 1.2. Configure environment variables

 1.3. Check the configured version of jdk

2. Android sdk installation can refer to: Mac Air Configuring Android Development Environment_Non-Biological Linguist’s Blog-CSDN Blog_Mac Configuring Android Development Environment

3. To install the framework environment, click the address to download and double-click to complete. Run and view the final components.

4. Script recording

1. Enter your username (enter your mobile phone number in the pop-up box and click sendkey)

2. Send verification code

3. Enter the verification code the same as step 1

4. Check the agreement as in step 2

5. Click to log in the same as step 2

6. Stop recording and select the generated script language (I chose python). Finally, select all the scripts, copy and paste them into a txt and change the suffix to .py.

 7. Open the script and add a waiting time (driver.implicitly_wait(10)) after webdriver.Remote. Sometimes the page component cannot be found if the component is directly obtained before the startup is completed.

8. Run the script (run in cmd: python login.py) to see the effect

Guess you like

Origin blog.csdn.net/qq_29653373/article/details/127552963