Futter Automation Testing: Appium

Appium Architecture

Appium is an open-source mobile app testing framework.

Appium Server is a web server running either locally or remotely, which handles communications between Appium Client and Application Under Test (AUT). For the former purpose, it serves JSON wire protocol; for the latter one, it implements WebDriver protocol.

Appium Client converts commands into HTTP requests, sending to the server. A variety of client language bindings are provided, meaning test cases in Appium can be written in Java, Python, JavaScript, and PHP etc.

Robot Framework acts as a Python wrapper of Appium Client. It features human-friendly DSL syntax using keywords. It converts DSLs into Appium commands, passing to the underlying client.

To interact with target device, Appium works in differernt ways on iOS and Android. - On iOS, an IPA of WebDriverAgent.app is installed on the target device and it acts as a running server. It listens to commands in WebDriver format and translates into XCUITest code. It employs XCUITest Framework to control AUT and simulates user intractions. After execution, return response to Appium Server. - On Android, the workflow is exactly the same, only to replace WebDriverAgent.app IPA with Bootstrap.jar APK and XCUITest Framework with UI Automator Framework.

To facilitate above process, Appium Server also needs to intall drivers: XCUITest driver for IOS, UIAutomator2 driver for Android and Appium Flutter driver for Flutter. The last one utilizes the first two underneath.

Appium Flutter driver also dependeds on flutter_driver in pubspec.yaml of AUT Flutter project.

References

Written on July 12, 2024