Current location - Music Encyclopedia - Dating - What are the automated testing tools for Android phones?
What are the automated testing tools for Android phones?

Feb 23 2012 update: There is also Sikuli (/truebit/AndroidWebDriver4Python. If you have any questions, you can mention it above

Based on Instrumentation: it can be installed in Android SDK r14

There are many that are not open source, but what I have seen are generally the following ideas:

1. Based on the Android Java Instrumentation framework:

Based on Robotium, such as bitbar Products: /products

Based on Instrumentation, it’s a big deal. Many companies’ own tools are based on this; in addition, Robotium is based on this

2. Based on Android lib Layer various commands, such as sendevent, getevent, monkey, service, etc., and then encapsulate them in various languages

MonkeyRunner is still very promising, and Google has developed it by itself. Now the latest dev version already supports UI. EasyMonkey for id operation. You can git clone git:///v_show/id_XNjQzMjI4NDcy.html?firsttime=2212

2, appium source code analysis

Ethanol appium source code interpretation

/v_show/id_XNjQzODIwMzA4.html?firsttime=0

Published on 2013-12-07 5 comments? Author reserves the right

Like 25 Dislike, will not be displayed Your name

Zhihu user, Coding/Reading/Hiking/Running

Zhihu user, Cao Yuanyuan, Shi Cunfeng and others agree

1. Monkey is Android The testing tool that comes with the SDK will send a pseudo-random user event stream to the system during the testing process, such as key input, touch screen input, gesture input, etc.) to implement stress testing of the application under development and also have log output. In fact, this tool can only perform some stress testing on programs. Since the test events and data are random and cannot be customized, it has great limitations.

2. MonkeyRunner is also a testing tool provided by 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 requires higher requirements for testers and involves relatively large learning costs.

3. Instrumentation is an early Android automated testing tool class provided by Google. Although JUnit could also test Android at that time, Instrumentation allows you to do more complex tests on applications and even frameworks. level. Through Instrumentation, you can simulate key presses, lifts, screen clicks, scrolling and other events. Instrumentation achieves 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 to monitor your main program while the program is running. The disadvantage is that for testers, the coding ability is relatively high, and they need to have a certain understanding of Android-related knowledge. They also need to configure the AndroidManifest.xml file, which cannot span multiple apps.

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 capture the control properties on the App page without looking at the source code). Based on Java, the test code has a simple structure, is easy to write, and is low-cost to learn. Once compiled, all devices or simulators can run the test, and it can run across apps (for example, many apps have the ability to select albums and open the camera to take pictures, which 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. Espresso is Google’s open source automated testing framework. Compared with Robotium and UIAutomator, it is smaller and more concise, its API is more precise, it is simple to write test code, and it is easy to get started quickly. Because it is based on Instrumentation, it cannot cross Apps. A simple example of writing tests with Android Studio

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

7. Robotium is also a testing framework based on Instrumentation. It is currently used more at home and abroad, has more information, and the community is more active. The disadvantage is that testers must have a certain Java foundation and understand the basic components of Android, and they cannot cross Apps.

8. Athrun is a mobile testing framework/platform developed by Taobao and supports both iOS and Android. The Android part is also based on Instrumentation, extending based on Android's original ActivityInstrumentationTestCase2 class to provide a complete set of object-oriented APIs. Here are the details.

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

Its advantages:

Its philosophy is:

Its design concept:

Relevant restrictions:

Summary:

In the iOS part, UIAutomation is encapsulated; Android 4.2 and above use UiAutomator, and Android 2.3 ~ 4.1 use Instrumentation, that is, Appium It also encapsulates 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.

If you use Appium on Windows, you cannot use precompiled .app files specifically for OS X. Because Appium relies on OS X-specific libraries to support iOS testing, you cannot test iOS on the Windows platform. Apps. This means you can only run iOS tests on a Mac.

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 the Client can use test scripts in multiple languages ??from the Appium client libraries, and the Server side can be deployed on the server or even a cloud server.

Session, each Client will have a Session ID after connecting to the Server, and the Client needs this Session ID to send commands to the Server, because this Seesion ID represents the browser or mobile phone you opened. Device emulator. 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. It sets some test-related information to tell the server whether we need to test iOS, Android, or change to WebApp and other information.

Appium Server is written in Node.js, so it can be installed directly using NPM.

Appium Clients provide GUI under Mac OS and Win. Node.js is not required, which is convenient for testers to operate.

Automated testing with Appium does not require recompiling the App;

Supports many languages ????to write test scripts, such as Java, Javascript, PHP, Python, C#, Ruby and other mainstream languages;

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 automated testing can get started directly);

Mobile automated testing should be open source;

Open source;

Supports Native App, Hybird App, Web App;

Supports Android, iOS, Firefox OS;

Server is also cross-platform. You can use Mac OS Object, your name will not be displayed

Zhihu user, hello rabbit

Hao Siyuan, man Nor, Xu Jiaqi and others agree

There is a big trend currently It is a shift to mobile application platforms. Android is the most widely used mobile operating system, accounting for more than 80% of the market in 2014. When developing Android applications, you need to conduct testing. There are a large number of testing tools on the market today.

The open source Android software testing tools mentioned in this article include: Android Test Kit, AndroidJUnit4, Appium, calabash-android, Monkey, MonkeyTalk, NativeDriver, Robolectric, RoboSpock, Robotium, UIAutomator, Selendroid.

Android Test Kit

Android Test Kit is a set of Google open source testing tools for the Android platform, including the Espresso API that can be used to write concise and reliable Android UI tests.

OSChina URL: Android Test Kit homepage, documentation and downloads

Related resources

* Android application testing with the Android test framework – Tutorial

* Espresso for Android is here!

AndroidJUnit4

AndroidJUnit4 is an open source command line tool that allows JUnit 4 to run directly on Android devices.

OSChina URL: AndroidJUnit4 homepage, documentation and downloads

Appium

Appium is an open source, cross-platform automated testing tool for testing native and lightweight Mobile application, supporting iOS, Android and FirefoxOS platforms. Appium drives Apple's UIAutomation library and Android's UiAutomator framework, using Selenium's WebDriver JSON protocol.

Appinm's iOS support is based on Dan Cuellar's iOS Auto. Appium also bundles Selendroid for testing on old Android platforms.

OSChina URL: Appium homepage, documentation and downloads

Related resources

* Appium Tutorial

* Android UI testing with Appium

p>

Calabash-android

calabash-android is a functional automation testing framework for Android based on Cucumber. Calabash allows you to write and execute. It is an open source automated mobile application testing tool that supports Android and iOS native applications. Calabash's library allows for interactive testing of native and hybrid applications involving a wide range of end-user activities. Calabash is comparable to Selenium WebDriver. However, it should be noted that the interaction between web applications and the desktop environment is different from the interaction between touch screen applications. Calabash provides APIs specifically for native applications on touch screen devices.

OSChina URL: calabash-android homepage, documentation and downloads

Related resources

* A better way to test Android applications using Calabash

* Calabash Android: query language basics

Monkey

Monkey is a UI/application testing tool developed by Google. It is also a command line tool, mainly for stress testing. You can run it on any emulator instance or device. Monkey sends a pseudo-random stream of user events to the system as a stress test for your developed application.

OSChina URL: UI/Application Exerciser Monkey

MonkeyTalk

MonkeyTalk is the world's most powerful mobile application testing tool.

MonkeyTalk automates real-world, functional interaction testing for iOS and Android apps. MonkeyTalk provides simple "smoke tests" and complex data-driven test suites.

MonkeyTalk supports native, mobile and hybrid apps, real devices or emulators. MonkeyTalk makes scene capture very easy and can record high-level, readable test scripts. The same command can be used on iOS and Android apps. You can record a test on one platform and play it back on another platform. MonkeyTalk supports mobile touch and gesture-based interaction-based mobile experiences. Clicks, drags, moves, and even finger drawings can be recorded and played back.

OSChina URL: MonkeyTalk homepage, documentation and downloads

Related resources

* Using MonkeyTalk in AndroidStudio

NativeDriver

NativeDriver is the implementation of WebDriver API and is a native application UI driver, not a web application.

OSChina URL: NativeDriver homepage, documentation and downloads

Robolectric

Robolectric is an Android unit testing framework that uses the Android SDK jar, so you can use the test Drivers for developing Android applications. The test takes just seconds to run in the workstation's JVM. Robolectric handles view scaling, resource loading, and a host of native C code implementations for Android devices.

Robolectric allows you to do most of the things you can do on a real device, running on a workstation or in a regular JVM continuous integration environment, without the need for an emulator.

OSChina URL: Robolectric homepage, documentation and downloads

Additional resources

* Better Android Testing with Robolectric 2.0

Using Robolectric for Android testing – Tutorial

RoboSpock

RoboSpock is an open source Android testing framework. Provides a simple method of writing BDD behavior-driven development specifications, using Groovy voice and supporting Google Guice library. RoboSpock merges the functionality of Robolectric and Spock.

OSChina URL: RoboSpock homepage, documentation and downloads

Related resources

* RoboSpock – Behavior Driven Development (BDD) for Android

Robotium

Robotium is a foreign Android automated testing framework. It mainly conducts black-box automated testing for Android platform applications. It provides simulation of various gesture operations (click, long press, slide, etc.), search and assertion mechanism API, which can operate various controls.

Robotium combines the testing framework officially provided by Android to achieve automated testing of applications. In addition, Robotium 4.0 version already supports the operation of WebView.

Robotium supports Activity, Dialog, Toast, and Menu.

OSChina URL: Robotium homepage, documentation and downloads

Related resources

* Robotium – Testing Android User Interface

* Android user interface testing with Robotium – Tutorial

UIAutomator

uiautomator testing framework improves user interface (UI) testing efficiency by automatically creating functional UI test examples that can be run on one or multiple devices your application.

OSChina URL: uiautomator homepage, documentation and downloads

Related resources

* Automatic Android Testing with UiAutomator

Selendroid

Selendroid is a UI automation testing framework for Android native applications. Tests are written using Selenium 2 client API. Selendroid can be used on emulators and real devices, and can also integrate grid nodes for scaling and parallel testing.

OSChina URL: Selendroid homepage, documentation and downloads

Related resources

* Mobile Test Automation with Selendroid

* Road to setup Selendroid and create first test script of android application

* Up and running with: Selendroid

Some Android testing tools that have stopped maintaining maintenance

Some open source tools that have almost no maintenance The Android Testing Tools project (at least the one that hasn't been updated in the last few months).

Emmagee

Emmagee is a performance testing tool that monitors the CPU, memory, and traffic resources of the machine occupied by the specified application under test during use. Emmagee also provides some very cool features, such as customizing intervals to collect data, using floating windows to present real-time process status, etc.

OSChina URL: Emmagee homepage, documentation and downloads

Sirocco

Scirocco (scirocco-webdriver) is an open source application automation testing tool that can be accessed from Eclipse. test equipment. Scirocco provides automated Android application testing capabilities to replace manual testing. Scirocco supports Google's NativeDriver and uses AndroidDriver as the main testing library. Scirocco includes three parts: NativeDriver, AndroidDriver, and scirocco plug-in (an Eclipse plug-in; it can automatically execute scenario tests and make test report screenshots).

OSChina URL: Scirocco homepage, documentation and downloads

via softwaretestingmagazine