I got a chance to go to Selenium Conference in Boston this year. It is always interesting to know how big shops like Facebook, Google, etc. manage their QA architecture, what new frameworks / technologies they are working on, and what can we learn from others. One automation testing framework for mobile which was talked about a lot was Appium. Appium uses Webdriver Json wire protocol to drive iOS and Android apps. Since our own iOS app at Rent The Runway is under development, I thought this would be the best time to try my hands on Appium and have some cool automation test scripts ready for our app. And now at this time when I have some pretty scripts ready for our app, I thought why not write a blog to share my experiences with Appium so far. When I initially started setting up Appium, I had a very little idea how to read the page source for the app to interact with it. After a little bit of searching I found something that they call an Inspector. The way Inspector works is it makes Page source calls to you app and displays the element hierarchy for you, making it possible to find the name, value etc of the objects on the app.
I use the page objects framework to write automation tests for the mobile app.The way I have set my framework is I have rake tasks in the Rakefile to run regression/ smoke iOS tests. Since eventually we will have a Jenkins job to run these tests I have not hard coded Appium serverURL and app path parameters in the code. Instead, I pass them in using the command prompt.
So if I have to run my regression suite for iOS, it is as simple as
rake ios:default IOS_TARGET="appium server url "" APP_PATH='location of the app path’
where ios:default is a task defined in the Rakefile.
We use watir webdriver to write scripts and by passing the correct capabilities object in the script, you are good to go. I would say I am pretty satisfied by how Appium has come up so far and I am very happy with the progress I have made with it but there are some challenges which I am facing.
Current Challenges and things to Expect:
I have often found that once my tests fail, the Appium server goes to state saying “clearing out any previous sessions” and it never comes out after that. So if I have to run my tests again I have to restart the server in order for the tests to succeed. In my local testing that's ok but when I add this job to Jenkins this causes major problems upon test failure.
I would also love to have these mobile tests run in parallel. Unfortunately, there is not much documentation out there on how to register a node to the Grid and run parallel tests using Appium. So hopefully my next blog will cover how I managed to solve my current challenges and run Appium tests in parallel. :)
Till then Keep Using Appium!