Appium is an amazing tool that offers a cutting-edge platform for implementing mobile test automation. In fact, Appium’s ability to implement test automation for both Android and iOS platforms has made it very popular.
Appium mobile testing provides an open-source tool and framework for automating native, mobile web, and hybrid applications on Android and iOS platforms. It works well on native apps – the ones that are written using the iOS or Android SDKs, mobile web apps that are accessed using a mobile browser as well as hybrid apps that are utilizing Webview and are wrapped inside your app. For example, Appium is also very popular among mobile game developers who typically use some advanced techniques for testing input-driven mobile games even running on two different platforms at the same time and by the same script.
- Real devices (iOS, Android)
- Simulators (iOS, Android, FirefoxOS)
- Hybrid apps (iOS, Android, FirefoxOS)
- Safari on iOS
- Chrome on Android
- Robot-controlled devices
- Client/Server Architecture:
Appium is at its heart a webserver that exposes a REST API. It receives connections from a client, listens for commands, executes those commands on a mobile device, and responds with an HTTP response representing the result of the command execution. The fact that we have a client/server architecture opens up a lot of possibilities: we can write our test code in any language that has a http client API, but it is easier to use one of the Appium client libraries. We can put the server on a different machine than our tests are running on. We can write test code and rely on a cloud service like Sauce Labs to receive and interpret the commands.
Automation is always performed in the context of a session. Clients initiate a session with a server in ways specific to each library, but they all end up sending a POST /session request to the server, with a JSON object called the ‘desired capabilities’ object. At this point the server will start up the automation session and respond with a session ID which is used for sending further commands.
- Desired Capabilities:
- Appium Server:
Appium is a server written in Node.js. It can be built and installed from source or installed directly from NPM:
$ npm install -g appium
The beta of Appium is available via NPM with npm install -g appium@beta. It is the development version so it might have breaking changes. Please uninstall appium@beta (npm uninstall -g appium@beta) before installing new versions in order to have a clean set of dependencies.
- Appium Clients:
- Appium Desktop:
There is a GUI wrapper around the Appium server that can be downloaded for any platform. It comes bundled with everything required to run the Appium server, so you don’t need to worry about Node. It also comes with an Inspector, which enables you to check out the hierarchy of your app. This can come in handy when writing tests.