Test Lab 支援使用 Google Play 提供的應用程式授權服務的應用程式。如要在使用 Test Lab 測試應用程式時順利檢查授權,您必須將應用程式發布至 Play 商店的正式版管道。如要使用 Test Lab 在 Alpha 或 Beta 頻道中測試應用程式,請先移除授權檢查,再將應用程式上傳至 Test Lab。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-03 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nRobo test is a testing tool that is integrated with Firebase Test Lab.\nRobo test analyzes the structure of your app's user interface (UI) and then\nexplores it methodically, automatically simulating user activities. Robo test\nalways simulates the same user activities in the same order when you use it to\ntest an app on a specific device configuration with the same settings. This\nrepeatable testing approach lets you use Robo test to validate bug fixes and\ntest for regressions.\n| **Note:** Robo test is not the same as (or based on) the Robotium or Robolectric test frameworks.\n\nRobo test captures log files, saves a series of annotated screenshots, and\nthen creates a video from those screenshots to show you the simulated user\noperations that it performed. These logs, screenshots, and videos can help\nyou determine the root cause of app crashes. These Robo test features can also\nhelp you find issues with your app's UI.\n\nIn addition to running regular Robo tests, you can customize your tests\nusing Robo scripts, which are a feature of Robo tests. To learn more,\nsee [Run a Robo script](/docs/test-lab/android/run-robo-scripts).\n\nIf you want to try the Beta version of Robo for iOS+, see [Run a Robo\nTest](/docs/test-lab/ios/robo-ux-test).\n\nRobo test crawl stats\n\nTo help you interpret your Robo test results, Robo test records stats during\neach test crawl. Test Lab displays the stats at the top of the Robo test tab\nin your test results page:\n\n- Actions: The total number of actions performed during the crawl,\n including Robo script actions, monkey actions, and Robo directives.\n\n- Activities: The number of distinct activities covered during the crawl.\n\n- Screens: The number of distinct screens visited during the crawl.\n\nTest Lab also uses the stats to create a visual representation of the Robo\ntest in the form of a crawl graph. The graph has screens as its nodes and\nactions as edges. By following the edges between screens, you can get an idea of\nhow Robo test traversed your app throughout the crawl.\n\nRobo test timeout\n\nDepending on the complexity of your app's UI, Robo test might\ntake five minutes or more to complete a thorough set of UI interactions. We\nrecommend setting the test timeout to at least 120 seconds (2 minutes) for most\napps, and 300 seconds (5 minutes) for moderately complex apps. The default value\nfor timeout is 300 seconds (5 minutes) for tests run from Android Studio and\nthe Firebase console, and 900 seconds (15 minutes) for tests run from the\n`gcloud` command line.\n\nApp start-up timeout errors\n\nIf your app takes a long time to start, Robo test can throw an error, and won't be\nable to crawl your app. This only happens in cases of extremely long start-up\ntime, and can only be resolved by revising your app to make it start faster.\n\nMore control with Robo scripts\n\nSometimes you need more control over your tests. For example, you might want to\ntest a common user journey or provide specific UI input like a username and\npassword. Robo scripts can help. To learn more about Robo scripts, see [Run a\nRobo script](https://firebase.google.com/docs/test-lab/android/run-robo-scripts)\nand [Robo scripts reference\nguide](https://firebase.google.com/docs/test-lab/android/robo-scripts-reference).\n\nRobo tests and non-Android UI widgets\n\nRobo tests use the Android API to perform actions on Android UI widgets\ndirectly. That helps the tests explore your UI automatically, but also means\nthat they need to be able to extract an Android UI hierarchy for a screen in\norder to run tests on it.\n\nIf a screen in your app doesn't use Android UI widgets, Robo tests fall back on\nMonkey Actions to test that screen. Unlike the more methodical\nRobo test actions, Monkey Actions simply simulate tap events on semi-random\nlocations on a device's screen.\n\nTo better test screens that don't use Android UI widgets, you can replace the\narbitrary taps of a Monkey Action with a set of scripted taps and interactions\nthrough\n[Firebase Test Lab Game Loop Tests](/docs/test-lab/android/game-loop).\n\nIntegration with Google Play\n\nYou can use Robo test in the Google Play Console when you upload and\npublish your app's APK file using either the alpha or beta channel. Robo test\nruns on a set of popular physical devices from different geographic locations,\nproviding test coverage across various form factors and hardware configurations.\nTo learn more, see\n[Use pre-launch reports to identify issues](https://support.google.com/googleplay/android-developer/answer/7002270).\n\nTest account sign-in and predefined text input\n\nRobo test supports test account sign-in, and also allows you to enter predefined\ntext into fields in your app. For custom sign-in and other predefined text\ninput, Robo test can enter text into\n[`EditText`](//developer.android.com/reference/android/widget/EditText.html)\nfields in your app. For each string, you need to identify the `EditText` field\nusing an Android resource name. To learn more, see\n[Accessing Resources](//developer.android.com/guide/topics/resources/accessing-resources.html).\n\nSign-in\n\nRobo test has two mutually-exclusive methods to support sign-in:\n\n- Custom sign-in: If you provide test account credentials, you need to tell\n Robo test where to enter them, and also provide those credentials.\n\n- Automatic sign-in: If you don't provide test account credentials for custom\n sign-in, automatic sign-in is used. Robo test can automatically sign in to\n apps built with standard Android widgets or Compose applications, using a\n Google test account.\n\n| **Note:** One automatic sign-in account is created per combination of project and app package. If your app prevents multiple concurrent sign-ins from a single account, you will need to run tests sequentially, or use custom sign-in.\n\nTo provide test account credentials for custom sign-in, do the following:\n\n1. On the **Select dimensions** page, choose **Additional options**.\n\n2. Under **Test account credentials (Optional)**, enter the username and\n password resource names and the username and password for the test account.\n\n| **Caution:** Only use credentials for test accounts that are not associated with real users.\n\nPredefined text input\n\nYou can provide custom input text for other text fields used by your app.\nTo provide text input for additional fields, do the following:\n\n1. On the **Select dimensions** page, choose **Additional options**.\n\n2. Under **Additional fields (Optional)**, enter one or more resource names, and\n the strings to enter in the corresponding text fields.\n\nPredefined text input {:#predefined-text} errors\n\nRobo test searches for `EditText` fields with an Android resource name that\nmatches a supplied regular expression. If Robo can't find a matching field,\nit doesn't input your text, but otherwise continues its crawl as usual.\n\nDeep links\n\nYou can provide up to three [deep links](//developer.android.com/training/app-links/deep-linking.html)\nsupported by your app for testing.\nDeep links are issued to your app as Android\n[`ACTION_VIEW`](//developer.android.com/reference/android/content/Intent.html#ACTION_VIEW)\nintents. Therefore, each link must match an intent filter in your app.\n\nIf one or more deep links are provided, the app is first launched\nnormally (using the\n[`ACTION_MAIN`](//developer.android.com/reference/android/content/Intent.html#ACTION_MAIN)\nintent) and crawled up to the specified timeout. After the main crawl, each deep\nlink is crawled for an additional 30 seconds each.\n| **Note:** Do not enter [Firebase Dynamic Links](/docs/dynamic-links) into these fields. Instead, enter the underlying URLs that the dynamic links are configured to target on Android.\n\nDeep link errors\n\nIf Robo test can't find an activity matching your deep link, Test Lab\nignores the link. Deep link issues are usually the result of a discrepancy\nbetween the provided deep link and its definition in your app. Check both\nthe provided URL and your app for typos or other inconsistencies.\n\nApp licensing support\n\nTest Lab supports apps that use the\n[App Licensing](//developer.android.com/google/play/licensing/index.html)\nservice offered by Google Play. To successfully check licensing when testing\nyour app with Test Lab, you must publish your app to the production channel\nin the Play store. To test your app in the alpha or beta channel using\nTest Lab, remove the licensing check before uploading your app to\nTest Lab.\n\nNext steps\n\n- Customize your tests [using Robo scripts](/docs/test-lab/android/run-robo-scripts)."]]