8 years of experience sharing - take you from 0 to learn the automation framework Airtest

Now there are many frameworks for UI automation on the market, including Selenium, our commonly used web automation framework, and Appium, a mobile automation framework.

Although Selenium and Appium belong to the same source, and the APIs have many similarities, they can be switched without loss , but they still need to introduce different libraries, and there is a big pain point in UI-level automation, which is that the element positioning will be worse. , so in this process, through various means, such as the introduction of OCR image recognition technology, many of them will use the original open-CV. In this process, the recognition rate is a major problem we have to solve.

In this case, a framework turned out to be the Airtest Project launched by Netease Games.

01. Component composition

The Airtest Project consists of several components:

  • Airtest: It is a cross-platform UI automation testing framework based on image recognition, suitable for games and apps, and supports Windows, Android and iOS platforms.
  • Poco: It is an automated testing framework based on UI control identification. It currently supports Unity3D/cocos2dx-*/Android native app/iOS native app/WeChat applet, and can also be used in other engines by accessing poco-sdk .
  • AirtestIDE: A cross-platform UI automation test editor with built-in Airtest and Poco related plug-in functions, which can be used to quickly and easily write Airtest and Poco codes.

In addition to the above components that can be used directly, Netease Games also provides a cloud testing platform AirLab , as well as a privatized mobile phone cluster technology solution. It can be used as a commercial solution.

As I just said earlier, the Airtest Project is mainly used for UI automation. In fact, UI layer automation has developed from a long-ago commercial solution to the current open source solution. It can be regarded as a long-term development direction in the field of automated testing. The framework is much more complicated. In terms of platform types, there are Windows Client, Linux graphical Client, Web UI, Android UI, iOS UI, and relatively new applets. These are all challenges to the UI layer automation framework.

02. Mainstream framework

01、Selenium

The first thing to introduce is Selenium, which has a long history. The most widely used component of Selenium is the WebDriver component. WebDriver is an open source web application automation testing framework, which can complete the operation of the browser by operating the browser's native API .

  • Selenium supports Windows, OSX and Linux graphical operating systems.
  • Selenium also supports current mainstream browsers, such as Chrome, FireFox, Safari, Windows Edge, IE, Opera, and some interfaceless browsers, such as Chrome headless, Phantomjs, etc.
  • Selenium is also a cross-language framework that can support various languages ​​such as Python, Java, Ruby, and C#.

How Selenium works:

Through the above introduction, we can see that Selenium is mainly based on the browser. Next, let's take a look at Appium, a commonly used mobile terminal framework.

02、Appium

Appium is a mobile-based open source automated testing tool that supports IOS, Android, Windows and Mac applications.

  • Appium supports Windows, OSX and Linux graphical operating systems.
  • Appium can also support multiple languages. It adopts the C/S design pattern and extends the WebDriver protocol. Therefore, the Client is implemented in various languages ​​such as Python, Java, Js/Nodejs, Ruby, OC, and C#.

Appium principle introduction:

At the heart of Appium is a web server that follows the REST design style, and he will be used to accept connections and instructions from clients. Due to the unified interface design, the client can be implemented in multiple languages, so that the test cases can be implemented in the language you like.

After receiving the test command, the server will send it to the device. At the device layer, the native test framework provided by the device manufacturer is used, such as XCUITest Driver and UIAutomation Driver for IOS, UIAutomator and UIAutomator2 for Android, etc.

Appium Android schematic:

Appium iOS schematic:

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

03、Airtest Project

Airtest Project is an automated testing framework developed by NetEase and open source. Compared with other automated testing frameworks, it has the following two advantages:

Significantly reduce the cost of writing and maintaining automation scripts. Airtest Project hopes to be able to complete the recording of scripts in a WYSIWYG way. Even if testers do not know how to program and do not understand scripts, normal users can click, drag and other operations , Automatically complete the recording of scripts, thereby greatly reducing the automation maintenance costs of enterprises and projects.

To solve the pain points of game testing, Airtest Project hopes to become a truly cross-engine and cross-platform automated testing platform by supporting different game engines.

Frames:

It can be seen that the main testing frameworks at the bottom are mainly Airtest and Poco. The difference between the two is:

  • Airtest: A Python-based, cross-platform UI automation testing framework, based on the principle of image recognition, suitable for games and apps.
  • Poco: An automated testing framework based on UI control search. Its core advantage is that in addition to Android and IOS, it also supports games, and also supports WeChat applets, WeChat games and H5 applications.

The entire framework is equipped with a very practical IDE. Through AirtestIDE, it is easy to complete the recording of scripts, the execution of test tasks and the generation of final test reports.

The following are supporting learning materials. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/myh919/article/details/132024680
Recommended