How to Appium: How to Use Appium – an API to Automate Mobile Apps

In this post, we’ll learning theoretical, but important things before start puts our hands-on code automating tests with Appium:

  • What is the Appium for
  • What you can do with Appium

 

What is Appium for:

Appium is an open source test automation framework for use with native, hybrid and mobile web apps. This is a good start to explain to you what is a native, hybrid and mobile web app. Before that Appium can automate apps developed for iOS Android mobile platforms. Now imagine you can use different programming languages to automate your mobile test like Java, C#, Python, Ruby, Swift, JavaScript, PHP and Pearl. Appium works with a good adherence when using iOS or Android.

Appium is based on Selenium WebDriver, so most commands have the same way to write, but applicable only in mobile. It brings all the powerful Selenium functionalities to your mobile test script like the fluency to write code, waits and ability to work with different devices.

How To Use Appium

All the basic things on a mobile device

You can do the basic interactions like: fill, tap/click, swipe. Also, you can do a lot of other interactions: open notification, install apps, reinstall apps, control Wi-Fi, data, airplane mode, rotate the screen, double tap, apply gestures and others interactions.

Use a real device, emulator or cloud

You can use a real iOS or Android device, as well emulators for Android like AVD – Android Virtual Device, Genymotion and other, and iPhone Simulator. There are some device cloud services in the market. They provide a way to connect (thanks Selenium WebDriver) in these devices with a less effort and you can use devices that expensive to buy or hard to find.

 

Run your tests in a Grid

In a professional way, you have some devices to test, right? So, you may connect many devices (or emulators) in your machine and execute some exhaustive and manual tests that make you bored and waste some time. With Selenium Grid you can connect iOS or Android devices and telling some information like the location (IP), name, platform, platform version and more. When the devices are registered on the grid you can tell to you test script in with device you would like to run and it can be based on device name, platform and platform version.

You can also run your tests in parallel if you create this approach in your mobile test project with a grid configured.

 

The sky is the limit

As Appium have total adherence to iOS and Android you can do what you can: enter on application, switch to platform and do some interactions and back to application again. Bellow you will see a test execution in an Android app. You can do all the testing stuff in mobile test automation with Appium.

 

appium_execution

 


 

About the Author

Elias_ Nogueira how to use appiumElias Nogueira is a QA Engineer, Agile Coach and Trainer at Adaptworks. He is also a Post-Graduate Professor at Unisinos. Elias wants to help teams and organisations to test software in all test dimensions, mainly in a technical way using automation to get  fast feedback. He contributes to the testing community through blog posts, tutorials, videos, workshops and presentation for testers and developers.

Elias blogs at eliasnogueira.com. He can also be found on Twitter and LinkedIn if you want to get in touch.

About the Author

Elias

Find out more about @elias-nogueira

Related Content