Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are 9 kinds of automated testing frameworks commonly used in Android

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "Android commonly used 9 kinds of automated testing framework is what", in daily operation, I believe many people in Android commonly used 9 kinds of automated testing framework is what problem there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation method, hope to answer "Android commonly used 9 kinds of automated testing framework is what" doubts helpful! Next, please follow the small series to learn together!

Difficulties in Mobile App Automation Testing

UI automation testing of mobile APP has long been a difficult point, and the difficulty lies in the "change" of UI, which leads to a lot of maintenance of automation use cases. From the perspective of layered testing, automated testing should be done layer by layer. Unit testing is the easiest to implement and the easiest to find problems in the early stage. The next is interface level testing, which is automated for the purpose of verifying logic. Due to the relative stability of the interface, the cost of automated testing is relatively acceptable. The automation cost is the largest. UI interface is the effect display that directly feeds back to the user. Moderate, especially BVT level automated testing is also very necessary.

To get rid of this, we need to introduce automated tests to assist us. Take advantage of the time I have to summarize the similarities and differences of several commonly used automated testing frameworks for Android, so that testers can refer to them when choosing an automated framework!

Comparison of several common automated testing frameworks for Android

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

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 and can write test scripts to customize data and events. The disadvantage is that the script is written in Python, which is more demanding for testers and has a relatively large learning cost.

Robotium is also a testing framework based on Instrumentation, mainly for automated testing of an APK, APK can have source code, can also have no source code, powerful; the disadvantage is that for testers to have a certain Java foundation, understand Android basic components, can not cross App.

Instrumentation is an early Android automated testing tool class provided by Google. Although JUnit can also test Android at that time, Instrumentation allows you to do more complex tests on applications, even at the framework level. It has a lot of rich high-level packaging, users can use other frameworks based on instrumentation, avoid excessive re-development. However, Instrumentation does not support cross-application, resulting in instrumentation-based frameworks inheriting this shortcoming.

UIAutomator is a testing framework provided by Google that provides advanced UI testing for native Android apps and games. 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).

Java-based, test code structure is simple, easy to write, learning cost, a compilation, all devices or simulators can run tests, can cross App (for example: many App have a choice album, open the camera to take photos, this is cross-App testing).

The disadvantage is that it only supports SDK 16 (Android 4.1) and above, and does not support Hybrid App and WebApp.

Espresso is Google's open source automated testing framework. Compared with Robotium and UIAutomator, it is characterized by smaller scale, simpler, more precise API, simple test code, and easy to use. Because it is instrument-based, it cannot cross apps.

Selendroid: A framework based on Instrumentation. Fully compatible with Webdriver protocol. Selendroid can be used on simulators and real devices, and can also integrate mesh nodes for scaling and parallel testing.

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

Appium is an open source, cross-platform automated testing tool, this framework should be the most powerful, I will describe in detail below.

Appium's Disadvantages

Its advantages:

(1) Open source;

Support Native App, Hybrid 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 require recompiling the App;

Support many languages to write test scripts, Java, JavaScript, PHP, python, C#, Ruby and other mainstream languages;

There is no need to remake 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;

At this point, the study of "What are the nine commonly used automated test frameworks for Android" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report