Android automated testing, 5 necessary testing frameworks

appium

Appium is an open source mobile testing tool that supports iOS and Android. It can be used to test any type of mobile applications (native, web and hybrid). As a cross-platform tool, you can run the same test on different platforms. In order to achieve cross-platform functionality, Appium uses the Android UI framework provided by the vendor to implement testing: XCTest is used in iOS, and UIAutomator or Instrumentation is used in Android. It encapsulates these vendor frameworks into Selenium WebDriver, which allows developers using Appium to write tests in various types of languages: Java, Objective-C, JavaScript, PHP, Ruby, Python, etc. This also makes writing Appium tests very similar to writing Selenium tests.

WebDriver was originally created for web testing. Appium extended WebDriver with additional API methods, making it more suitable for mobile automation.

Here are some useful Appium features:

  • No need to install anything on the device.
  • No need to recompile or change the application to match Appium.
  • Appium has a very large and active community.
  • Appium comes with a tool for scanning and analyzing the UI components of the application-Appium UI Inspector. Developers can also use Android Studio's UI Automator Viewer.
  • If you need to write tests for iOS and Android, and you are a Selenium lover, Appium will be a good choice. 

Calabash

Calabash is an open source mobile testing tool developed and maintained by Xamarin. It supports native and hybrid applications on iOS and Android. Calabash testing supports gesture recognition (gesture), assertions (assertions) and screenshots (screenshots) and other functions, usually integrated with the drive development testing tool Cucumber.

Xamarin announced in 2017 that it will stop continuing development of Calabash. In view of this decision, you can use Calabash as a less than ideal alternative test solution.

Espresso

Espresso is an Android UI framework from Google. It is a lightweight white box tool for application developers, which means that to take full advantage of it, test developers must be fully familiar with and use application code. Espresso's test is very reliable and runs very fast. Since Espresso can access the internals of UI objects, it can be used to test WebView, that is, the development of hybrid applications.

The disadvantage of Espresso is that it can only test one application at a time and cannot access device resources. However, this problem can be easily solved by using joint tests created by UI Automator.
Sauce Labs supports Espresso's real device testing.

If you exchange experience in software testing, interface testing, automated testing, and interviews. If you are interested, you can add software test communication: 1085991341, and there will be technical exchanges with colleagues.

UI Automator

UI Automator is a mobile testing Android UI framework developed and maintained by Google. Its main function includes cross-application functional testing, that is, testing multiple applications and switching between installed and system applications.

UI Automator is a black box testing tool, which means that test developers do not need to know the internal application structure and can rely entirely on visible UI elements. The UI Automator test is written in Java and consists of two sets of APIs: one is UI Automator APIs, which are UI components that control applications; the other is device state APIs, which are used to access and execute operations on the device (such as changing Rotate the device, press the arrow button, press Back, Home or Menu button, etc.). It also comes with a very useful UI Automator Viewer, which is a graphical user interface tool that can scan and analyze the UI components currently configured on the device.

The disadvantage of UI Automator is that it does not support WebView built on top of hybrid Android applications. Therefore, UI Automator only supports native Android applications.

robots

Robotium is an open source Android UI framework. It was born in 2010 and is now a very mature and stable tool. The most recent version is 5.6.3, which was released in September 2016. In the latest versions, the test readability and test execution speed have been significantly improved.

Most of the technical blogs, tutorials and courses related to Robotium are of the black box test type. But in fact, it is considered gray box testing, because writing Robotium tests requires understanding the internal application structure.

The following are some of the main features of Robotium:

  • Support native and hybrid applications.
  • Tests can be run on real devices and simulators.
  • Supports complete Android UI tools: activities, buttons, menus, toasts, dialog boxes, etc.
  • Support gestures.
  • There are some device control functions: change device orientation, screenshot, unlock screen, etc.
  • Robotium recorder is a paid plugin for Android Studio and Eclipse. This is a good tool that can quickly start and run tests.
  • Can be run as part of continuous integration.
  • Robotium's language of choice is Java.

Robotium is supported by Sauce Labs and can be used for testing of real equipment.

Conclusion

Choosing the right Android UI framework for your project is a very challenging task. In some cases, you may need to use multiple tools to achieve the right balance. This is the support of multiple tests like Sauce Labs The reason why the framework's test grid is so popular.
The above content is the entire content of this article. The above content hopes to be helpful to you. Friends who have been helped are welcome to like and comment.

Guess you like

Origin blog.csdn.net/Chaqian/article/details/106697539