Level Up Your Mobile and Web Application Testing with AWS Device Farm

Ishan Nayak
Simform Engineering
6 min readJul 5, 2023

Take Application Testing to the Next Level: Embrace AWS Device Farm’s Game-Changing Features

In the fast-paced world of mobile app development, ensuring a seamless user experience across various devices and operating systems is paramount. Enter AWS Device Farm, a cloud-based mobile application testing service offered by Amazon Web Services. With its extensive device fleet, automation capabilities, and convenient cloud-based access, AWS Device Farm has become an invaluable tool for software testers to streamline their mobile app testing processes. In this blog post, we will explore the features, benefits, and best practices of AWS Device Farm, highlighting how it can revolutionize your mobile app testing strategy.

There are two main ways to use Device Farm:

  1. Remote access of devices onto which you can load, run, and interact with apps in real-time.
  2. Automated testing of apps using a variety of testing frameworks.

1. Remote Access Interaction

Remote access allows you to swipe, gesture, and interact with a device through your web browser in real-time. There are several situations where real-time interaction with a device is useful. For example, customer service representatives can guide customers through the use or setup of their devices. They can also walk customers through the use of apps running on a specific device.

You can install apps on a device running in a remote access session and then reproduce customer problems or reported bugs. During a remote access session, Device Farm collects details about actions that take place as you interact with the device. Logs with these details and video capture of the session are produced at the end of the session.

Here’s a step-by-step example of using AWS Device Farm for remote access:

Step 1: Set up an AWS Account

If you don’t already have an AWS account, create one at aws.amazon.com.

Step 2: Navigate to AWS Device Farm

Once logged into your AWS account, go to the AWS Management Console and search for “Device Farm” in the services search bar. Click on “AWS Device Farm” to open the Device Farm console.

Step 3: Create a Project

In the Device Farm console, click “Create a new project” and add a name for your project. A project helps you organize your test runs and test artifacts.

Step 4: Choose Devices

AWS Device Farm offers a wide range of real devices for testing. Select the devices you want to use for your test runs. You can choose specific devices and device pools, or even create your custom device pools.

Step 5: Upload Your Application

Prepare your mobile or web application package for testing. For mobile apps, you can upload the APK or IPA file.

Step 6: During the remote access session, you can interact with the device, install additional apps, capture screenshots, collect logs, and perform manual testing or debugging.

2. Desktop Browser Automation Testing with Selenium Java

When it comes to automation testing frameworks, there are various options available for use with AWS Device Farm. One popular framework worth exploring is Selenium with Java, which allows for efficient desktop browser testing. In this section, we will take a closer look at how Selenium Java can be used in AWS Device Farm for desktop browser testing.

Step 1: Create a Project

In the Device Farm console, under Desktop browser testing, click “New project.”

Step 2: Give a project name and description (optional) and click on the Create button.

Note: If you are running your script locally, you don’t need to add any VPC details.

Step 3: Now create a Maven project and add the following dependencies for the AWS SDK in the POM.XML file:

Step 4: Create one class and add the following script as mentioned in the screenshot:

Reference link: https://docs.aws.amazon.com/devicefarm/latest/testgrid/testing-frameworks-java.html

Step 5: Replace myProjectARN with your project ARN as shown below in the screenshot:

Step 6: Add the Selenium script to perform the desired operations on the browser. For example, launching and closing the browser.

Step 7: Go to https://us-east1.console.aws.amazon.com/iamv2/home#/security_credentials and create a user.

Step 8: Select the user, go to the security credential tab, and generate the access and secret key for that user.

Step 9: Set the Access key and secret key as environment variables to enable AWS Device Farm access.

Step 10: Run the script locally.

Step 11: Navigate to the Project section under the session to access a list of test runs.

Step 12: Under session id, you will get the session videos, actions, and file details.

Best Practices for Using AWS Device Farm

  • Prioritize device coverage: Select a diverse range of devices to cover the majority of your target audience and ensure thorough testing.
  • Leverage automation: Take advantage of automation frameworks supported by AWS Device Farm to execute tests across multiple devices efficiently.
  • Optimize test suite: Focus on high-value test cases to maximize test coverage while minimizing execution time.
  • Monitor performance: Use performance testing capabilities to identify and resolve performance bottlenecks proactively.
  • Collaborate effectively: Share detailed test reports with developers and maintain clear communication channels to expedite issue resolution.

Conclusion

AWS Device Farm revolutionizes mobile app testing by providing a scalable, efficient, and cost-effective solution. Its extensive device fleet, automation capabilities, remote access, and performance testing features empower software testers to ensure app compatibility, performance, and quality across a diverse range of devices and operating systems. By leveraging AWS Device Farm, you can streamline your testing processes, accelerate bug identification and resolution, and deliver high-quality mobile applications that impress your users.

For more updates on the latest tools and technologies, follow the Simform Engineering blog.

Follow Us: Twitter | LinkedIn

--

--