What tools are generally used for automated testing apps?

Now automated testing has been applied to daily testing. This is not surprising, because automated testing saves time in the testing process and can also avoid testing errors and omissions caused by human factors.

There are many options for automated testing tools. Some are open source, some are very expensive. Some automation tools came out a few years ago, some just came out on the market. Each tool has certain characteristics and is unique.

Among the many alternative automation tools, it is more difficult to choose the right tool for the project. The problem is that hardly any existing tools are fully adapted to the requirements of the project.

In order for automated testing to be effective and beneficial, it must have:

1. Research and test the software products in the project;

2. Identify which tests need to be automated

3. Develop requirements for automated testing and automated testing tools

4. Research at least a few available and suitable automation tools

5. Choose the most suitable tool or tools based on research

6. Discuss the chosen automation tool with other project parties, explain the reasons for the choice, and get their approval

7. Promote automation

These methods and steps are recognized by most quality assurance experts.

Many different types of computers have appeared recently, and their appearance has begun the rapid development of software products. The most surprising thing is the evolution of mobile devices. They have different characteristics, methods and interaction conditions from ordinary personal computers.

Therefore, the mobile applications required by smart phones are also different from laptops.

The operating system of most personal computers is Windows. The popular mobile operating systems are Android, Apple iOS, BlackBerry OS, Windows phones, Symbian and others.

Android testing tools

Let us explore the automated testing tools supported by the more popular mobile operating systems.

1. Robotium Android test tool

Robotium is a frequently used automated testing tool software that supports Android.

Robotium is a free Android UI testing tool. It is suitable for testing automation for different Android versions and sub-versions. Software developers often describe it as Android Selenium. Robotium tests are written in java. In fact, Robotium is a unit testing library.

But it takes a lot of time and effort to create a test through Robotium, because the program source code needs to be modified in order to automate the test. The tool is also not suitable for interaction with system software, it cannot lock and unlock smartphones or tablets. Robotium also does not have recording and playback functions, nor does it provide screenshots.

2. MonkeyRunner Android application test

Monkeyrunner is a popular Android testing tool for automated functional testing.

This tool is one level lower than Robotium. This does not have to deal with source code for automated testing. This test can be written in Python, and a recording tool can be used to create the test.

Monkeyrunner can connect to a computer or simulate a real device to run tests. The tool has an interface to control the Android code of a smartphone, tablet or external emulator.

The disadvantage of this testing tool is that it must be scripted for each device. Another problem is that every time the user interface of the test program changes, the test script needs to be adjusted.

3. Ronaorex Android test application tool

Ranrex is a version that not only supports the latest Android version, but also supports early versions and branch versions starting from Android 2.2.

The advantage of Ranorex is that it has detailed screenshot reports. It can connect smart phones and tablets via Wifi.

An automated test engineer can write data-driven tests in detail without using the XML data format through this Android tool. Ranorex Studio enables automated test engineers to easily create tests with just a click of the mouse. It allows detailed declaration of additional program modules for testing more complex scenarios in the later development cycle.

It is a commercial mobile application tool with a license price of 1990 euros. However, Ranorex's search function is quite slow; it takes 30 seconds to complete such an operation. We must equip Ranorex with an apk file device, otherwise, this tool cannot be used to automate testing because it can only work on APK file devices.

4. UiAutomator is also an automated testing framework provided by Android. It basically supports all Android event operations. Compared with Instrumentation, it does not require testers to understand the code implementation details (you can use UiAutomatorviewer to grab the control properties on the App page without looking at the source code). Based on Java, the test code structure is simple, easy to write, and costly to learn. Once compiled, all devices or simulators can run the test, and it can run across apps (for example, many apps have selected photo albums and opened cameras to take pictures. This is cross-app testing). The disadvantage is that it only supports SDK 16 (Android 4.1) and above, and does not support Hybird App and WebApp.

5. Huawei MobileTest

Huawei MobileTest provides automated traversal testing of Android APK compatibility, based on automated real machine testing, to help developers find defects and locate problems.

6. Monkey is a test tool that comes with the Android SDK. During the test, it sends pseudo-random user event streams to the system, such as key input, touch screen input, gesture input, etc.) to achieve stress testing of the application under development. There is also log output. In fact, the tool can only do some stress testing for programs. Because the test events and data are random and cannot be customized, it has great limitations.

7, MonkeyRunner is also a testing tool provided by the Android SDK. Strictly speaking, MonkeyRunner is actually an Api toolkit, which is more powerful than Monkey. You can write test scripts to customize data and events. The disadvantage is that the script is written in Python, which requires higher requirements for testers and has a relatively large learning cost.

8. Instrumentation is an Android automated testing tool class provided by Google in the early days. Although JUnit can also test Android at that time, Instrumentation allows you to do more complex tests on applications, even at the framework level. Through Instrumentation you can simulate events such as button presses, lifts, screen clicks, and scrolling. Instrumentation implements these functions by running the main program and the test program in the same process. You can think of Instrumentation as a component similar to Activity or Service without an interface, and monitor your main program during the running of the program. The disadvantage is that for testers, the ability to write code is relatively high, they need to have a certain understanding of Android-related knowledge, and they also need to configure the AndroidManifest.xml file, which cannot span multiple apps.

9. Appium Android Automation Framework

This is a framework that can do automated testing for iOS and Android. It is an open source tool. It supports Android versions from 2.3 and later. Appium uses the WebDriver interface to run tests. It supports multiple programming languages ​​such as java, C#, Ruby and other languages ​​in the WebDriver library.

It can control Safari and Chrome on mobile devices. Appium and these browsers can be used to test mobile websites.

But some automated test engineers complained that it did not have a detailed report. Its weakness also reduces XPath support on mobile devices.

10. Espresso is Google's open source automated testing framework. Compared with Robotium and UIAutomator, it is characterized by smaller scale, more concise, more precise API, simple test code writing, and easy to get started quickly. Because it is based on Instrumentation, it cannot cross App. Cooperate with Android Studio to write a simple test example

11. Selendroid: It is also a testing framework based on Instrumentation, which can test Native App, Hybird App, Web App, but there is less information on the Internet and the community is not very active.

12. Robotium is also a testing framework based on Instrumentation. At present, it is used more at home and abroad, with more information, and the community is more active. The disadvantage is that testers must have a certain Java foundation, understand the basic components of Android, and cannot cross App.

13. Athrun is a mobile testing framework/platform from Taobao, which supports both iOS and Android. The Android part is also based on Instrumentation, which is extended on the basis of Android's original ActivityInstrumentationTestCase2 class to provide a complete set of object-oriented APIs. Here is a detailed introduction.

14. Appium is a popular framework recently, and the community is also very active. This framework should be the most powerful,

Its advantages:

Open source

Support Native App, Hybird App, Web App;

Support Android, iOS, Firefox OS;

Server is also cross-platform, you can use Mac OS X, Windows or Linux;

Its philosophy is:

Automated testing with Appium does not need to recompile the App;

Support many languages ​​to write test scripts, mainstream languages ​​such as Java, Javascript, PHP, Python, C#, Ruby;

There is no need to reinvent the wheel for automated testing because WebDriver is extended. (WebDriver is a simple and fast automated testing framework for testing WebApps, so testers with experience in web automation testing can get started directly);

Mobile automated testing should be open source;

Its design philosophy:

Client/Server architecture. When running, the server will listen to the commands sent by the client, translate these commands and send them to the mobile device or simulator, and then the mobile device or simulator will respond. It is precisely because of this architecture that Client can use Appium client libraries' test scripts in multiple languages, and the Server side can be deployed on the server or even the cloud server.

Session, each Client will have a Session ID after connecting to the Server, and this Session ID is required for the Client to send commands to the Server side, because this Seesion ID represents the browser you open or the emulator of the mobile device. So you can even open N sessions and test different devices or simulators at the same time.

Desired Capabilities is actually a key-value pair. Set some test-related information to tell the Server side that we need to test iOS, Android, or WebApp.

Appium Server is written by Node.js, so it can be installed directly with NPM.

Appium Clients, GUI provided under Mac OS and Win, no need to install Node.js, which is convenient for testers to operate.

Related restrictions:

If you use Appium on Windows, you cannot use pre-compiled .app files dedicated to OS X, because Appium relies on OS X-specific libraries to support iOS testing, so you cannot test iOS Apps on the Windows platform. This means you can only run iOS tests on a Mac.

to sum up:

UIAutomation is encapsulated in the iOS part; UiAutomator is used for Android 4.2 and above, and Instrumentation is used for Android 2.3 ~ 4.1, which means that Appium encapsulates both UiAutomator and Instrumentation. So Appium has all the advantages of the above major frameworks: cross-App, supports Native App, Hybird App, Web App, and supports N languages ​​to write your test scripts.

Test automation is a complex task. It requires adequate preparation and research. Various novel applications and automated testing tools that need to keep up with information technology. All this knowledge is necessary to create the most effective test.
If you need more real interview questions, please call: Q8787ja Interview 8853 real questions.

Guess you like

Origin blog.csdn.net/cemaxueyuan/article/details/108430909