当前位置:网站首页>Appium automation test foundation - Summary of appium test environment construction

Appium automation test foundation - Summary of appium test environment construction

2022-07-05 06:03:00 Test - Eight Precepts

1、Appium The overall idea of building test environment

(1)Android Test environment construction

Android The test environment needs to build three environments ,Java,AndroidSDK,Android Simulator .
Why install these three environments ?

  • Java:Android The language used in the application layer of is Java, So we need to use Java Environmental Science .
  • AndroidSDK:Android SDK Here you are. Provide Development 、 What's necessary for testing Android API Class library .
  • Android Simulator : It's actually a cell phone , Let's show you the effect .

(2)Appium Test environment construction

Appium The test environment needs to be built

  • Appium Server:
    yes Appium At the heart of , Provides a set of REST API Of Web The server .
    Appium Received client connection 、 Monitoring command , Then execute these commands on the mobile device , Finally, put the execution results in HTTP The response is returned to the client .
    Can pass Node.js install , It can also be done through Appium Desktop start-up Appium Server service .
  • Appium Clients:
    appium The government provided a set of Appium client, Covering multiple languages ruby/java/python etc. ,
    During the test , Generally use these client Library to replace native webdriver library .
    Let's make it easier to write test cases with better readability .
  • Devices:
    It's our mobile device , It can be a real mobile phone , Or on the computer Android Simulator .
    (Android Simulator we finished in the last step )

(3) Build the environment for testing the scripting language

for example :Pyhtonj、Java And so on .
To use Pyhton Language to write our test script , Just build Python Language development environment , Including development tools .
To use Java Language to write our test script , Just build Java Language development environment , Including development tools .

2、Appium stay Android End sum IOS End workflow

(1)Android

stay Android End ,Appium be based on WebDriver agreement , utilize Bootstrap.jar, Finally, by adjusting ⽤ use UiAutomator The order of , Realization App Automated testing .
UiAutomator The test framework is Android SDK Self contained App UI automated testing Java library .
In addition, due to UiAutomator Yes H5 Limited support for ,Appium Introduced chromedriver as well as safaridriver Based on H5 Automation .
appium stay android End workflow

  1. client The end is us test script(webdriver The test script ).
  2. The middle is started Appium Service for ,Appium At the service end, a Server(4723 port ), Follow selenium Webdriver The test framework is similar to , Appium⽀ Standard WebDriver JSON Wire Protocol.
    Here it provides a set of REST The interface of ,Appium Server receive webdriver client standard rest request , Parse request content , transfer ⽤ Respond to the operation with the corresponding framework .
  3. appium server Will forward the request to the middleware Bootstrap.jar, It is to use java Written , Installed on the phone Bootstrap monitor 4724 Port and receive Appium The order of , Finally, by adjusting ⽤ use UiAutomator To achieve .
  4. Last Bootstrap Will be returned to the execution of Appium server.
  5. Appiumserver Then return the result to Appium client.

(2)ios

stay IOS End ,Appium Also make ⽤WebDriver A set of agreements for .
And Android The difference between the end-to-end test framework is ,appium ios Encapsulates the apple Of Instruments frame , Mainly used Instrument Inside UI Automation(Apple Of ⾃ Automated testing framework ), And then put... In the device ⼊ Enter into bootstrap.js Into the ⾏ Line monitoring .
appium stay ios End workflow

  1. client End Is still test script(webdriver The test script ).
  2. In the middle is starting Appium Service for ,Appium At the service end, a Server(4723 port ), Follow selenium Webdriver The test framework is similar to ,Appium⽀ Standard WebDriver JSON Wire Protocol.
    Here it provides a set of REST The interface of ,Appium Server receive webdriver client standard rest request , Parse request content , transfer ⽤ Respond to the operation with the corresponding framework .
  3. appium server call instruments.js start-up ⼀ One socket server, At the same time, a sub process is separated ⾏instruments.app, take bootstrap.js( One UIAutomation Script ) notes ⼊ In device⽤ To interact with the outside world
  4. Last Bootstrap.js Will be returned to the execution of Appium server
  5. Appium server Then return the result to Appium client.

(3) summary :

So we can see android And ios The difference lies in Appium Forward the request to bootstrap.js perhaps bootstrap.jar.
Then from bootstrap drive UIAutomation and UiAutomator Go to Devices Complete specific actions on .

3、ADB Execution principle and Appium Execution principle

(1)ADB principle :

ADB Schematic diagram of simple model ( follow 12345 Step walk )

(2)ADB Refer to the actual operation principle diagram

(3)Appium principle

Appium Simple schematic diagram ( Follow the serial number 12345678 go )

(4)Appium Principle actual reference diagram ( Combined with simple schematic diagram )

a key : Supporting learning materials and video teaching

So here I have carefully prepared the detailed information of the above outline in The link below is as follows

原网站

版权声明
本文为[Test - Eight Precepts]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050549591301.html