Conducting Robo Tests with Firebase Test Lab

Conducting Robo Tests with Firebase Test Lab

We all know testing is important. Very important. While it seems simple on the surface, it goes way deep. There are so many different methods of testing like say, unit tests, integration tests, UI tests, the list goes on.

In comes Firebase Test Lab which lets you perform a couple of these on real physical devices running in a Google data centre. Because you’re conducting these tests remotely, you can do it on many of those devices simultaneously.

What’s a Robo Test

A robo test is the simplest way to test your app through the test lab, and arguably the second simplest test you can do overall (beaten only by the mighty unit test). As the name implies, the program simulates user interaction with the app, going through the app methodically and trying to spot any errors or noticeable points along the way.

There a few things to keep in mind with robo tests:

  • The test always simulates activities in the same order when testing across different devices with the same configuration and settings
  • The test captures logs, screenshots, and videos to help you determine the cause of errors or spot UI errors
  • A test can take several minutes depending on app complexity. You can set a test timeout to work around this
  • A perdetermined robo test script can fail if it can’t find necessary elements on screen. The robo test will still continue if this happens
  • The test cannot properly work with non-Android UI Frameworks (like Unity) and Sign-in Captchas

How to Conduct a Robo Test

It’s actually piss easy. Just grab an APK (Android) file and head to Firebase Console > Test Lab to stick it in. The robo test will automatically crawl through your app. Optionally, you can upload a script if you want your test to crawl through your app in a specific manner.

Predefined Text Inputs

If you want to test with predefined text entered into your app’s EditText fields, you can identify them by their resource names.

Go to Select Dimensions > Show Advanced Options > Additional Fields (optional) and there you can identify the fields and the data to go with them.

Test Account Sign-In

Just like with predefined text inputs, you can determine a test account if your app requires authentication. If your app provides Google authentication, this process is automatically done using your Google account. Whether or not it does, you can still determine a test account. (Just don’t use a real user’s account for obvious reasons)

Go to Select Dimensions > Show Advanced Options > Test Account Credentials (optional) and enter the resource names of the username and password fields along with their corresponding data.

Deep Links

Up to three deep links can be provided in the test. The app will first be run normally (without any deep links), and then after the main test each deep link will be tested for 30 seconds each.

Again, go to Select Dimensions > Show Advanced Options > Deep Links (optional) and enter the links.

Conclusion

That’s it for Robo Tests. A simplicity burger with a few addable layers. Let this serve as an introduction. These next couple of weeks, we’ll be diving even deeper into the Test Lab.