Applause Helps Improve Automated Testing Capabilities for Android in Appium

Applause has a goal to enable organizations to test as thoroughly and efficiently as possible, whether or not you’re leveraging Applause’s global community of trained testers.

Our Engineering and QA teams here at Applause use Appium on a regular basis. When we noticed that Appium, the leading solution for automated mobile tests, had built-in support for mjpeg screenshot streaming on iOS but not on Android, this made us pause. We wanted to see if it would be possible to add this feature for Android, so we worked with the Appium team at Sauce Labs to make it happen.

Why Screenshot Streaming?

With automated functional testing for mobile apps, knowing that a test failed is helpful, but it’s better to have visuals that tell the story.

Screenshot streaming, similar to video recordings, captures what is happening in an app over time and makes it possible to get a much clearer picture of what happened during testing. However, screenshot streaming is more interactive and optimizes the performance in the process because the device is pushing data to the client — rather than the client having to repeatedly poll the device for updated information.

In that way, screenshot streaming brings a closer-to-real-time experience than video because you're essentially looking at the test as it happens. This helps the tester detect issues that could be easily missed otherwise, and additionally decreases the time to iterate during test development.

Screenshot streaming brings a closer-to-real-time experience than video because you're essentially looking at the test as it happens.

For example, automatically capturing a streaming of an application process that fails can reveal the user’s precise clicks or touches before the failure. Or streaming images of failed tests for collision detection in a mobile action game can quickly identify problems with an object’s bounding box.

There are an endless number of situations where having a screenshot stream can pinpoint problems within an app, and when it comes to testing, knowing more is always better. In many testing scenarios, having a screenshot stream helps provide the full context.

Appium in Automated Device Testing

Today, Appium is the go-to test automation framework for mobile devices because it allows cross-platform testing on devices and emulators with zero dependencies on the app and the operating system. We use Appium at Applause — and love it.

With Appium, you don’t need to add any SDK or library code to your app. It works by translating WebDriver automation commands into native mobile device commands for iOS through XCUITest, and for Android via UiAutomator2.

The XCUITest driver supports screenshot streaming through an mjpeg server functionality. This enables us to simply open a web browser to the local URL and view a livestream of the device screen, with configurable screenshot quality and framerate through the Appium settings API. This feature was missing from UiAutomator2.

Because screenshot streaming can be such a critical tool for discovering issues during automated functional testing, finding out that this capability was not available for Android devices inspired the Applause Labs team to get our hands dirty (and our code ready) to make this happen.

Having recently built this capability into our fork of the UiAutomator2 repository and wanting to give back to the open-source community, our Applause Labs team worked directly with the Appium team to add this feature to UiAutomator2 with the same configurable settings that were available in XCUITest. We submitted a pull request to be merged into Appium along with changes to the documentation. Screenshot streaming for both iOS and Android devices is now available in the beta release and will be available in the next major release of the Appium platform.

Screenshot streaming for both iOS and Android devices is now available in the beta release.

Better Testing for Everyone

Having screenshot streaming makes Appium’s Android testing capabilities match those available for iOS devices. For us at Applause, simultaneous cross-platform testing of mobile apps is especially valuable because it helps ensure that the testing experience and results are consistent across platforms.

It was a great experience working with the Appium team to add this feature to UiAutomator2 for Android devices. We are happy to be a contributing member of the Appium open-source community: our work together makes automated testing better for everyone.

Next time you are testing an app on an Android device with Appium, give screenshot streaming a try. Share your best app clip with us because we would love to see it in action.

Ebooks

5 Ways To Win With Mobile Automation

Pitfalls to avoid and best practices to consider when taking on automation.

Read '5 Ways To Win With Mobile Automation' Now
Want to see more like this?
Jonathan Zaleski
Sr. Director of Engineering & Head of Applause Labs
Reading time: 5 min

How to Assess Testing Resource Allocation

If you can’t measure the value of your efforts, you can’t explain or even justify your testing investment

Using Questionable Datasets to Train AI Could Come With High Costs

As companies look to capitalize on AI development, they must stay mindful of how they source training data — AI algorithms developed from private or non-consensual data may cost businesses in the long run.

Why Payment Testing is a Constant for Media Companies

Simulated transactions and pre-production testing won’t ensure friction-free subscriber payment flows

How Mobile Network Operators Can Leverage e- and iSIMs

We explain what e- and iSIMs are, what they mean for the industry and how MNOs and MVNOs can leverage them to their advantage.

Jumpstart Your Software Testing Education

Testers have a variety of options to upskill and grow professionally

The Future of Generative AI: An Interview with ChatGPT

We ask ChatGPT about where it sees itself in the future, what needs to happen for it to get there and how Applause can help.