Mobile App Testing: A Brave New World
Is application testing for mobile similar to standard testing for software?
If the answer to this question was ‘yes’, then the lives of software would be easier, but unfortunately it’s a resounding no. Testing of mobile applications varies in several ways as the device range is much greater meaning standard software testing courses don’t cut it as you are testing for so many different things in a mobile software testing course
One of the key distinctions is the way in which Appium; the most popular screening tool for mobile apps differs from Selenium; which is one of the most common tools for screening of non-mobile applications. Appium and Selenium operate differently meaning the degree of automation allowed for in tests is implicated in a significant way.
By comparing Selenium and Appium against one another, I’ve been able to gain some insights about how to maximise the use of each tool. Below is what I found out.
Selenium the popular browser based suite of automation tools, is a vital application for screening since it automates web browser testing.Automating tests for web applications is not the only useful feature of Selenium, automating online administrative jobs is another useful feature. Because of this a lot of DevOps Engineers feel you’re essentially getting double the value with Selenium.
It’s important to remember that Selenium isn’t one single tool but instead several smaller tools which when combined make up two central functional parts
- Selenium WebDriver
- Selenium IDE
The largest issue with Selenium; which has become obvious due to the popularity of smart phones for everything, is that the program was not developed for mobile app automation testing. Fortunately Appium addresses this core issue. Based on Selenium (just like Selendroid), Appium is a program specifically developed for automated testing of mobiles.
Appium Architecture: Wrritten in Node.js using a REST API, Appium is a HTTP webserver. Apps do not need to be recompiled due to Appium employing automation frameworks provided by the vendor like Google’s UiAutomator or Apple’s UIAutomation. This allows for the app that you test to become the app that is delivered. Language-locking (also known as framework-locking) is excluded as automation frameworks provided by the vendor are embedded inside the WebDriver API. Client-server protocols are specified by this API. This allows for the appropriate HTTP server requests to be written in any language by the client.
Only a couple of alterations are needed to allow for the WebDriver protocol to deal with mobile as when it comes to web browser automation, WebDriver is the standard. Another benefit of Appium is that it’s open source. Github has freely available information on the Appium architecture if you want to know more.
Appium Sessions: In Appium, a session is simply the automation of an individual mobile internet browser test. A HTTP POST request to the server is sent out by every client with a “desired capabilities element (also known as a JSON object). Thus this allows for the server to simultaneously launch the session and respond with a session ID which can then be utilised later on in the session. A set of keys and values called desired capabilities indicate what type of automation sessions a user conducts by sending this information directly to the Appium server. Other capabilities can also be used during automation to modify server behaviour (a complete list of capabilities can be found through a quick google search). For the reasons above, Appium is viewed as one of the best methods for automating application screening for mobile web.
Testing of mobile applications is unique and differs greatly from standard testing of web applications due to multiple devices requiring a varied software tester to deal with different operating system versions. However, automation tools for internet browsers like Selenium can have their frameworks modified to make them compatible for mobile test automation. Thus Selenium can be used like Appium. Obviously, regardless of whether you choose Selenium or Appium, both tools can be utilised through Sauce Labs’ cloud-based testing platform.