A successful mobile application has two things in common. First needs to be bug-free and another is its user-friendliness. For this to come to be, every mobile application must go through rigorous testing and bug fixing. As the mobile device users increase, so does the mobile devices. So, it is imperative to test them using many scenarios. One such scenario is testing it using Cloud Technology. Specifically, using Appium test framework using AWS clouds.
With an ever-changing technology landscape of Cloud Infrastructure Management services, testing mobile applications via clouds become imperative. As per a recent survey, a whopping 95% user abandon an app in the first month due to content and engagement issues. The biggest non-content reasons for abandonment are application crashes and security concerns.
The reasons behind of using a cloud for a useful mobile testing service are: instant access to many real devices, ability to run parallel tests, excellent reporting, ability to configure the device state, and little to no modifications to your existing test setup.
AWS Device Farm is provisioned for rapid testing of Android, iOS and FireOS mobile applications on many smartphones and devices on AWS clouds. It is as simple as upload and runs to test results. A user simply needs to upload their App to test framework known as Appium and that provisions you to test your app on the go. Moreover, AWS device farm will run the tests and send you optimized reports for the test including logs, metrics, and screenshot for app performance and whether it passed the test or not.
Introduction of Appium as Mobile Automation Tool
Appium is an Open Source mobile automation testing framework. It allows automation of native, hybrid and mobile web applications for iOS, Android and Windows. Using Appium, we can execute automation test on physical mobile devices and emulator/simulator as well.
Appium supports “cross-platform” test execution, means test are written for multiple platforms (iOS, Android & Windows) use the same API.
You shouldn’t have to recompile your app or modify it in any way in order to automate it.
You shouldn’t be locked into a specific language or framework to write and run your tests.
A mobile automation framework shouldn’t reinvent the wheel when it comes to automation APIs.
A mobile automation framework should be open source, in spirit and practice as well as in name.
Running Appium on multiple devices simultaneously
Parallel test execution is always essential to reduce efforts and increase the productivity. Appium also supports simultaneous execution.
Let’s assume that 4 devices are connected to the PC and when you type the adb devices command, it will fetch out all the devices connected to your PC. Now to run the same Appium script on multiple devices simultaneously, you need to run multiple Appium servers. Every instance of Appium server has to be registered with the hub.
Hence to run the test on ten different devices, you need to run ten Appium nodes. Such implementation leads to high system memory consumption and it becomes more tedious when required to sync many more devices.
Plus, to buy all sorts of device available in the market & run your test on each one of them individually is expensive and difficult to maintain. To overcome this challenge we can integrate existing Appium test on suitable Device Farm. Through Device Farm, you get to access thousands of Mobile devices and Tablets available in wide range of OS versions.
Few such device farms are available in market as mentioned below:
AWS Device Farm
Google Cloud Test Labs
Xamarin Test Cloud
We have utilized AWS Device Farm for various reasons like easy to setup, test execution reliability, range of available devices etc.
Introduction of AWS Device Farm & integration with Appium
Device Farm is an app testing service hosted by Amazon Web Services (AWS) that provides you platform to test and interact with your iOS, Android and Web Applications on real mobile devices and tablets. Device farm can be utilized mainly two ways:
Automated Testing of app using testing frameworks.
Remote access of device for real time interaction.
Automated tests written with Appium needs to be uploaded on AWS device farm. Once the upload and integration is successfully done, testing is automatically performed in parallel on multiple selected devices. Post execution a test report containing high-level results, screen-shots and low-level logs is generated.
AWS Device Farm currently supports for following Appium test types (Android, iOS & Web Apps):
Appium Java JUnit
Appium Java TestNG
Steps to integrate your Appium Test with AWS Device Farm
Here we will look at setup of Appium Java TestNG on AWS device farm. Below are the prerequisites before getting started with the integration:
Appium Java TestNG Project
AWS Device Farm User Account
Eclipse IDE + Maven
Appium (currently device farm supports 1.4.16)
Before uploading your Appium Java TestNG project to device farm, it should be converted into a package.zip file. This package should contain all of test’s dependencies. Below are the steps to meets these requirements during package stage of Maven build.
4. Save the following XML assembly to src/main/assembly/zip.xml
The following XML is an assembly definition that, when configured, instructs Maven to build a .zip file containing everything in the root of your build output directory and the dependency-jars directory:
2. From the list of Projects, select the option where you can upload your tests.
3. Select “Create a new run” button.
4. From “Choose Your Application”, choose Upload.
5. Browse and open your application having .apk format.
6. On the Configure a test page, choose Appium Java TestNG, and then choose Upload.
7. If your package is uploaded successfully, you will be asked to select devices from device pool.
8. Next and last step is to review your test and initiate the Run.
9. After completion of execution, AWS Device Farm will give execution status containing a test report with high-level results, screen-shots and low-level logs.
Mobile App testing with Appium on AWS makes it easier to control the test environment and predict the outcomes via cloud computing. It allows complete access and control to large device clouds or server farms that feature humongous real mobile devices. Which in turn, will emulate and simulate test conditions and parameters to meet their objective and report any discrepancies. This negates the need to use own devices and adapt them to meet the application testing. Certainly, testing apps via AWS clouds on Appium will dominate the application testing in the future.
Watch our webinar: Mobile Automation on AWS Device Farm using Appium
This blog has been written by our Senior QA Consultant Rishil Bhatt.
https://www.knowarth.com/wp-content/uploads/2020/04/playing-the-long-game.png4001140Chintan Shahhttps://www.knowarth.com/wp-content/uploads/2017/01/knowarth-logo.pngChintan Shah2020-04-29 15:19:482020-04-29 17:15:43Playing the Long Game and adapting to change in times of crisis
https://www.knowarth.com/wp-content/uploads/2017/02/SAAS-based-productivity-management-suite.jpg6571920Krupal Khatrihttps://www.knowarth.com/wp-content/uploads/2017/01/knowarth-logo.pngKrupal Khatri2017-02-28 15:19:302017-02-28 16:39:41SAAS based productivity management suite
https://www.knowarth.com/wp-content/uploads/2016/11/Amazon-Web-Services-AWS-to-Open-Stack-Migration.jpg6571920KNOWARTH Adminhttps://www.knowarth.com/wp-content/uploads/2017/01/knowarth-logo.pngKNOWARTH Admin2016-11-22 17:51:202017-01-30 11:46:29Amazon Web Services (AWS) to Open Stack Migration