Run a Robo test (Android)

Robo test is a testing tool that is integrated withFirebase Test Lab.Robo test analyzes the structure of your app's user interface (UI) and thenexplores it methodically, automatically simulating user activities. Robo testalways simulates the same user activities in the same order when you use it totest an app on a specific device configuration with the same settings. Thisrepeatable testing approach lets you use Robo test to validate bug fixes andtest for regressions.

Note: Robo test is not the same as (or based on) the Robotium or Robolectrictest frameworks.

Robo test captures log files, saves a series of annotated screenshots, andthen creates a video from those screenshots to show you the simulated useroperations that it performed. These logs, screenshots, and videos can helpyou determine the root cause of app crashes. These Robo test features can alsohelp you find issues with your app's UI.

In addition to running regular Robo tests, you can customize your testsusing Robo scripts, which are a feature of Robo tests. To learn more,seeRun a Robo script.

If you want to try the Beta version of Robo for iOS+, seeRun a RoboTest.

Robo test crawl stats

To help you interpret your Robo test results, Robo test records stats duringeach test crawl.Test Lab displays the stats at the top of the Robo test tabin your test results page:

  • Actions: The total number of actions performed during the crawl,including Robo script actions, monkey actions, and Robo directives.

  • Activities: The number of distinct activities covered during the crawl.

  • Screens: The number of distinct screens visited during the crawl.

Test Lab also uses the stats to create a visual representation of the Robotest in the form of a crawl graph. The graph has screens as its nodes andactions as edges. By following the edges between screens, you can get an idea ofhow Robo test traversed your app throughout the crawl.

Robo test timeout

Depending on the complexity of your app's UI, Robo test mighttake five minutes or more to complete a thorough set of UI interactions. Werecommend setting the test timeout to at least 120 seconds (2 minutes) for mostapps, and 300 seconds (5 minutes) for moderately complex apps. The default valuefor timeout is 300 seconds (5 minutes) for tests run from Android Studio andtheFirebase console, and 900 seconds (15 minutes) for tests run from thegcloud command line.

App start-up timeout errors

If your app takes a long time to start, Robo test can throw an error, and won't beable to crawl your app. This only happens in cases of extremely long start-uptime, and can only be resolved by revising your app to make it start faster.

More control with Robo scripts

Sometimes you need more control over your tests. For example, you might want totest a common user journey or provide specific UI input like a username andpassword. Robo scripts can help. To learn more about Robo scripts, seeRun aRobo scriptandRobo scripts referenceguide.

Robo tests and non-Android UI widgets

Robo tests use the Android API to perform actions on Android UI widgetsdirectly. That helps the tests explore your UI automatically, but also meansthat they need to be able to extract an Android UI hierarchy for a screen inorder to run tests on it.

If a screen in your app doesn't use Android UI widgets, Robo tests fall back onMonkey Actions to test that screen. Unlike the more methodicalRobo test actions, Monkey Actions simply simulate tap events on semi-randomlocations on a device's screen.

To better test screens that don't use Android UI widgets, you can replace thearbitrary taps of a Monkey Action with a set of scripted taps and interactionsthroughFirebase Test Lab Game Loop Tests.

Integration with Google Play

You can use Robo test in the Google Play Console when you upload andpublish your app's APK file using either the alpha or beta channel. Robo testruns on a set of popular physical devices from different geographic locations,providing test coverage across various form factors and hardware configurations.To learn more, seeUse pre-launch reports to identify issues.

Test account sign-in and predefined text input

Robo test supports test account sign-in, and also allows you to enter predefinedtext into fields in your app. For custom sign-in and other predefined textinput, Robo test can enter text intoEditText fields in your app. For each string, you need to identify theEditText fieldusing an Android resource name. To learn more, seeAccessing Resources.

Sign-in

Robo test has two mutually-exclusive methods to support sign-in:

  • Custom sign-in: If you provide test account credentials, you need to tellRobo test where to enter them, and also provide those credentials.

  • Automatic sign-in: If you don't provide test account credentials for customsign-in, automatic sign-in is used. Robo test can automatically sign in toapps built with standard Android widgets or Compose applications, using aGoogle test account.

Note: One automatic sign-in account is created per combination of project andapp package. If your app prevents multiple concurrent sign-ins from a singleaccount, you will need to run tests sequentially, or use custom sign-in.

To provide test account credentials for custom sign-in, do the following:

  1. On theSelect dimensions page, chooseAdditional options.

  2. UnderTest account credentials (Optional), enter the username andpassword resource names and the username and password for the test account.

Caution: Only use credentials for test accounts that are not associated withreal users.

Predefined text input

You can provide custom input text for other text fields used by your app.To provide text input for additional fields, do the following:

  1. On theSelect dimensions page, chooseAdditional options.

  2. UnderAdditional fields (Optional), enter one or more resource names, andthe strings to enter in the corresponding text fields.

Predefined text input {:#predefined-text} errors

Robo test searches forEditText fields with an Android resource name thatmatches a supplied regular expression. If Robo can't find a matching field,it doesn't input your text, but otherwise continues its crawl as usual.

Deep links

You can provide up to threedeep links supported by your app for testing.Deep links are issued to your app as AndroidACTION_VIEW intents. Therefore, each link must match an intent filter in your app.

If one or more deep links are provided, the app is first launchednormally (using theACTION_MAIN intent) and crawled up to the specified timeout. After the main crawl, each deeplink is crawled for an additional 30 seconds each.

Note: Do not enterFirebase Dynamic Linksinto these fields. Instead, enter the underlying URLs that the dynamic linksare configured to target on Android.

Deep link errors

If Robo test can't find an activity matching your deep link,Test Labignores the link. Deep link issues are usually the result of a discrepancybetween the provided deep link and its definition in your app. Check boththe provided URL and your app for typos or other inconsistencies.

App licensing support

Test Lab supports apps that use theApp Licensingservice offered by Google Play. To successfully check licensing when testingyour app withTest Lab, you must publish your app to the production channelin the Play store. To test your app in the alpha or beta channel usingTest Lab, remove the licensing check before uploading your app toTest Lab.

Next steps

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.