The Pros and Cons of different UI automation test tools - Appium
The majority of the last open-source testing tools I’ve written about have been primarily web focused. Appium though is different as it is built with the purpose of automating native, web, and hybrid applications that run on mobile devices, primarily iOS and Android apps, but is also capable of running Windows applications and therefore able to achieve a certain level of desktop app automation as well. Something which has been critical in a world increasingly dominated by mobile devices.
Appium – first released in 2012 by Dan Cuellar, is an open-source framework that is built on the foundations of Selenium, making use of the same WebDriver API that Selenium uses for web browsers. As such, it operates on a very similar basis making use of a Mobile JSON Wire Protocol for its testing scripts. ?Appium consists of a REST API in which commands can then flow between the different devices and the machine/server hosting Appium and driving the flow of control between the different devices.
Additionally, like Selenium, Appium is designed in a modular fashion with individual drivers operating each independent device connection. This allows it to handle automation across different devices in a parallel and independent fashion, while also making the core functionality of the service itself quite easy to maintain as core functionality can be altered with the use of different modules and drivers to suit the needs of the automation.
And while the core Appium application may be Node.JS based, this modular design allows the tool to support many different programming languages, making it easy to integrate into many existing test formworks that companies already have. Its similarity to Selenium also means it can interact with a lot of the same plugins, creating a wide range of interoperability with existing tools.
Typically, in order to use Appium for test automation, it’s good to have an understanding of its basic architecture and workflow:
1.??????Appium server: Appium is a client-server architecture, where the Appium server is the backend that interacts with the mobile device and the application being tested.
2.??????Desired capabilities: Before executing tests, the user specifies desired capabilities such as the device type, platform version, application path, etc., that Appium uses to create a session with the device and application.
3.??????Session creation: Appium creates a session with the device and application by sending a request to the Appium server with the desired capabilities.
4.??????Appium client libraries: The test script interacts with the Appium server using client libraries available for multiple programming languages. These libraries provide methods to interact with the mobile device, such as tapping, swiping, scrolling, entering text, and more.
领英推荐
5.??????Automation frameworks: Appium uses the automation frameworks provided by mobile platforms (such as UIAutomation for iOS and UiAutomator for Android) to interact with the application being tested. The client libraries send requests to the Appium server, which in turn sends commands to the automation frameworks on the device.
Once all of these steps have been done, the Appium server can use the needed driver to execute on the device under test.
Appium does behave differently depending on the device it is testing with the below two diagrams showing the difference in approach between how it works across the two most popular mobile operating systems, Android and iOS.
Some of the pros of using Appium include:
Some of the cons of using Appium include:
When to select Appium:
If you have a big mobile presence and aren’t prepared to pay for very expensive automation tools, then Appium should be on your list of tools to assist you with your test automation efforts. It offers a lot of features, provides coverage across different platforms and devices, and integrates well with existing frameworks, making it the obvious choice for open-source mobile automation.?