App Testing agent (Android)

The App Testing agent is a test case generation, management, and execution agent powered by Gemini in Firebase. You define test goals in natural language, and the agent uses AI to understand and navigate your app, simulate user interactions, and provide detailed test results.

How App Testing agent uses your data

App Testing agent is provided by Gemini in Firebase and is governed under the same terms. See How Gemini in Firebase uses your data for more information about how Gemini in Firebase uses your data.

Before you begin

If you haven't already, register your app with Firebase.

If you aren't using any other Firebase products, you only have to create a project and register your app. You don't need to add any SDKs to your app. However, if you decide to use additional products in the future, be sure to complete all of the steps in Add Firebase using the Firebase console.

When you're ready to distribute a pre-release version of your app to testers, build your APK or AAB, using your normal process, and upload it to App Distribution in the Firebase console. You must sign the APK with your debug key or app signing key.

Create a test case

To run AI-guided tests, the App Testing agent uses your natural language test cases to execute tests against your app.

Each test case is broken down into steps, which will be executed in sequence. Steps allow you to break up your test case into phases, each with their own success criteria. The agent may take many actions during any one step.

To create a test case, open the App Distribution page of the Firebase console and take the following steps:

  1. On the Test Cases tab, click New test case. If you don't want to create your own test case, you can modify or use the provided example test case.
  2. In the Add test case dialog, give the test case a name. This is used to identify the test, but is ignored by the agent.
  3. Consider breaking your test into multiple steps, by clicking the Add another step button.
  4. Give each step a Goal that describes what the App Testing agent should do during that step.
  5. (Optional) Add a Hint to provide additional information to help the App Testing agent understand and navigate your app during that step.
  6. (Optional) Add Success Criteria to help the App Testing agent determine when the step has been successfully completed.
  7. Click Save once you're done customizing your test.

Example test case

The following is an example of how to create a test case using the App Testing agent:

Testing the home page
Test title

Home page loads

Goal

Load the home page

Hint

Navigate past any onboarding screens. Dismiss any popups. Don't sign in.

Success Criteria

The main app home page is visible on screen, all images have loaded, and no errors are displayed.

Run a test

The App Testing agent lets you run AI-guided tests in the console by clicking the Run tests button from either the Releases or Test Cases page. This opens the App Testing agent customization screen, where you can choose one or more of your existing test cases for the agent to execute. You can also choose the devices you want to test against, and whether to provide any login credentials.

You can also choose to run a Random crawl test by changing the test type. Random crawl tests use the Automated Tester feature.

You can view the results of your tests from the Releases page in the App Testing agent tab of a release. The View details button will open the Test Results dialog and show you any issues, screenshots of the app, and the actions that Gemini took during the test.

Automatically test your builds

To automatically run App Testing agent tests on your new builds, for example from CI/CD pipelines, you can distribute your builds to the agent using App Distribution's Gradle or fastlane plugins, or the Firebase CLI.

Debug your test results

If your test results are different from what you expected, you can debug your test using the Show agent view toggle under View details on the Test Results page. The agent view shows you the on screen elements that the App Testing agent was able to detect when using the app's accessibility information. If you would like to take a closer look at what the agent saw, you can download that information from the action overflow menu.

You can also use the View artifacts button on the Test Results page to look at all of the videos, logs, and other Cloud artifacts for your test results.

Known issues and limitations

The App Testing agent preview has some known limitations:

  • Because the App Testing agent uses generative AI to test your app, it will sometimes take different actions while still following the same instructions.
  • The App Testing agent only supports the following actions: tap, enter text, scroll up, scroll down, and wait.
  • The App Testing agent has trouble executing tests containing only a single step that takes many actions to accomplish. It performs better when complex tasks are broken up into multiple shorter steps.
  • The App Testing agent sometimes won't scroll to expose other elements off screen. This happens more often when there is no visual indication of scrollability. As a workaround, the "hints" field can be used to suggest scrolling.
  • The App Testing agent sometimes has trouble counting, for example performing an action a specific number of times.

Testing quotas

During the preview, the AI-guided tests will be offered at no cost within a quota limit. The default quota limit is 100 tests per month.

Note that if you choose to run multiple test cases, or run the same test case, on multiple devices, this counts as multiple tests. For example, if you run 2 test cases on 2 devices, this counts as a total of 4 tests.

To increase your quota above the default limit, contact Firebase Support with your use case.