이 문서에서는 모바일 앱의 수동 QA 작업을 자동화하고 지속적 통합(CI) 및 사전 출시 테스트 전략을 가능하게 하는 테스트인 Robo 스크립트를 사용하는 방법을 설명합니다. 예를 들어 Robo 스크립트를 사용하여 사용자 경험을 테스트하거나 사용자 이름 및 비밀번호 같은 특정 사용자 인터페이스(UI) 입력을 제공할 수 있습니다. Robo 스크립트는 Robo 테스트의 기능입니다.
Robo 스크립트를 사용하면 앱에서 워크플로를 따르는 과정을 직접 기록한 후 기록 내용을 Firebase Console에 업로드해 Robo 테스트에서 실행할 수 있습니다. 스크립트가 첨부된 Robo 테스트를 실행하면 Robo에서 사전 스크립트 처리된 작업을 먼저 수행한 후 평소와 같이 앱을 탐색합니다.
Robo 스크립트는 Robo 테스트를 테스트 엔진으로 사용합니다. 가장 기본적인 형태의 Robo 스크립트는 텍스트 '사용자 이름' 입력 후 확인 버튼 탭과 같은 UI 작업의 시퀀스로 구성됩니다. 또한 Robo 스크립트에는 요소가 표시될 때까지 기다린 후 요소 내의 특정 지점을 탭하고 Android 디버그 브리지(adb) 셸 명령어를 실행하는 등의 작업도 포함될 수 있습니다.
Robo 스크립트는 기존 테스트 프레임워크에 비해 다음과 같은 장점이 있습니다.
기능
설명
매우 강력함
Robo 스크립트는 앱 버전과 앱 결함 간의 상당한 구조 및 동작 차이를 허용할 수 있습니다.
서술형
Robo 스크립트가 완료되면 기본 Robo 테스트가 인계되어 앱 테스트를 계속할 수 있습니다. 이 지속적인 테스트 접근 방식을 통해 몇 가지 주요 사용 사례가 가능합니다. 예를 들어 Robo 스크립트로 커스텀 로그인 과정을 진행하여 앱을 특정 상태로 전환할 수 있습니다.
녹화 가능
Robo 스크립트를 수동으로 코딩할 필요가 없습니다. Android 스튜디오에서 Robo 스크립트 레코더를 사용하여 기록할 수 있습니다. Robo 스크립트를 만들거나 수정할 때는 일반적으로 모바일 개발 지식이 필요하지 않습니다.
유연성
Robo 스크립트는 게임에서 일반적으로 사용되는 네이티브가 아닌 UI 요소와 상호작용할 수 있습니다.
Robo 스크립트는 Robo 테스트 중에 조건부로 트리거되므로 사용자가 Robo의 동작을 보완하여 일반적으로 더 넓은 범위 또는 특정 기능을 타겟팅할 수 있습니다. 기존 테스트 프레임워크와 달리 Robo 스크립트는 다음을 지원합니다.
특정 앱 패키지 이름이 활성 상태인지 여부 또는 특정 요소가 화면에 표시되는지 여부와 같은 다양한 트리거 조건을 지원합니다.
최대 실행 횟수, 우선순위 및 관련 크롤링 단계와 같은 실행을 제어합니다.
색다른 작업 유형(조건부, 요소 무시, 화면 닫기)
Robo 스크립트는 유지 관리가 간편하므로 가능하면 사용하는 것이 좋습니다. 예를 들어 Robo 스크립트를 사용하여 다음을 수행할 수 있습니다.
의미 있는 워크플로를 탐색하여 앱 기능의 핵심을 파악합니다.
예를 들어 로그인을 수행하고, 최초 실행 후 앱의 상태를 설정하고, 신규 사용자를 등록할 수 있습니다.
Robo를 앱의 특정 부분에 집중하여 Robo 테스트 시간을 최대한 활용할 수 있습니다. Robo 스크립트가 Robo 테스트를 통해 앱의 관련 부분에 도달하도록 합니다. 여기서 Robo 테스트는 완전히 자동화된 크롤링을 다시 시작합니다.
예를 들어 인앱 메시지, 개인정보처리방침 또는 게임의 특정 수준을 분석하기 위해 앱을 특정 상태 또는 화면으로 가져옵니다.
Robo 스크립트가 완료된 후 Robo 테스트와 관계없이 엔드 투 엔드 계측 테스트를 실행하여 완전히 자동화된 크롤링을 재개합니다.
고급 Robo 스크립트 기능을 사용하여 다음을 수행합니다.
Robo에서 테스트 중인 앱 크롤링을 시작하기 전이나 크롤링이 완료된 후 작업을 실행합니다. 예를 들어 크롤링 전에 테스트 중인 앱 데이터를 정리하거나 기기 설정을 변경합니다.
크롤링 중 Robo 동작의 요소를 변경합니다.
Robo에서 일부 UI 위젯 또는 앱 화면을 무시하도록 합니다.
Robo가 특정 화면에서 되돌아갈 때 실행할 커스텀 작업을 제공합니다.
Robo가 크롤링 중에 특정 앱 화면이 발생할 때마다 특정 작업을 실행하도록 합니다.
Robo에서 크롤링을 수행하는 방법을 완전히 맞춤설정합니다. 예를 들어, 기기 조작을 수행하고 그 과정에서 표시되는 팝업 대화상자를 닫는 동안 조건부 작업과 비조건부 작업의 조합을 사용하여 크롤링 중에 테스트 중인 앱을 백그라운드 상태로 유지합니다.
Robo 스크립트가 모든 종류의 테스트를 대체하는 것은 아닙니다. 앱에서 하위 수준의 로직 버그를 포착하려면 여전히 단위 테스트가 필요합니다. 이러한 테스트에는 일반적으로 Android 또는 iOS 환경이 필요하지 않습니다. 코드에서 가장 정확하게 표현되는 비즈니스 로직에 관한 구체적인 상세 어설션을 포함할 수 있는 타겟팅된 계측 테스트로 Robo 스크립트 테스트를 보완하는 것이 좋습니다.
Android 스튜디오에서 Test Lab을 사용하여 Robo 스크립트 기록
Android 스튜디오의 Robo 스크립트 레코더를 사용하면 기기에서 앱과 직접 상호작용하여 Robo 스크립트를 기록할 수 있습니다. Android 스튜디오에서 Firebase 도구를 통해 Robo 스크립트를 시작하려면 다음 안내를 따르세요.
Firebase 창에서 Robo 스크립트 기록 및 Robo 테스트에 적용하기를 클릭합니다.
Robo 스크립트 기록을 클릭합니다. 배포 대상 선택 대화상자가 나타납니다.
Robo 스크립트를 기록하려는 기기를 선택합니다.
기기에 Robo 스크립트를 기록한 후 원하는 위치에 파일을 JSON 파일로 저장합니다.
Firebase Console에서 Test Lab 페이지를 열고 JSON 스크립트 파일 및 애플리케이션 APK를 업로드합니다.
계속 버튼을 클릭합니다. 기기와 API 수준을 선택하라는 메시지가 표시됩니다. 테스트 스크립트가 완료되면 Test Lab에서 테스트 보고서를 생성합니다.
(선택사항) 테스트 보고서 및 동영상의 Logcat을 복사하거나 다운로드하려면 소스 파일 보기를 클릭합니다.
기본적으로 Robo 스크립트 견고성 메커니즘은 조기에 실패하지 않도록 방지합니다.
strict 실행 모드를 선택하고 어느 시점에서든 Robo 스크립트가 실패할 경우 Test Lab이 스크립트의 모든 추후 단계를 취소하고 일반 Robo 크롤링을 재개합니다. Robo 스크립트가 실패하는 대부분의 이유는 Robo가 화면에서 필요한 요소를 찾을 수 없기 때문입니다. 실패하지 않도록 하려면 앱 탐색이 예측 가능한지, 화면이 확정적인 순서로 표시되는지 확인하세요.
Test Lab에서 Robo 스크립트 실행
Test Lab에서 Robo 스크립트를 실행하려면 다음 안내를 따르세요.
Firebase Console에서 Test Lab 페이지를 엽니다.
앱 APK 또는 AAB 필드에 앱의 APK 또는 AAB를 업로드합니다.
기록되거나 수동으로 만든 Robo 스크립트 파일을 Robo 스크립트(선택사항) 필드에 업로드합니다.
로컬 Robo 테스트 실행에 Robo 스크립트 제공
로컬 Robo 테스트 실행에 Robo 스크립트를 제공하려면 다음 Robo 테스트 옵션을 사용합니다.
--robo-script-file <robo-script-path>
<robo-script-path>를 로컬 파일 시스템의 Robo 스크립트 파일 경로로 바꿉니다. 로컬 Robo 테스트 실행 안내를 따릅니다.
gcloud CLI 테스트 호출에서 Robo 스크립트 지정
gcloud CLI 테스트 호출에서 Robo 스크립트를 지정하려면 다음 gcloud CLI 플래그를 사용합니다.
--robo-script = <robo-script-path>
<robo-script-path>를 로컬 파일 시스템의 Robo 스크립트 파일 경로 또는 gs:// 표기법을 사용하여 Cloud Storage의 경로로 바꿉니다. 예를 들면 다음과 같습니다.
gcloud firebase test android run --app = <path_to_app_apk_file> --robo-script = <robo-script-path>
[null,null,["최종 업데이트: 2025-08-28(UTC)"],[],[],null,["\u003cbr /\u003e\n\nThis document describes how to use *Robo scripts* , which are tests that\nautomate manual QA tasks for mobile apps, and enable continuous integration\n(CI) and pre-launch testing strategies. For example, you can use Robo scripts\nto test a common user journey or provide specific user interface (UI) input,\nlike a username and password. Robo scripts are a feature of\n[Robo test](/docs/test-lab/android/robo-ux-test).\n\nWith Robo scripts, you record yourself walking through a workflow in your app,\nthen you upload that recording to the Firebase console to run in Robo\ntests. When you run a Robo test with a script attached, Robo first steps\nthrough your pre-scripted actions and then explores the app as usual.\n\nRobo scripts use [Robo test](/docs/test-lab/android/robo-ux-test)\nas the test engine. In its most basic form, a Robo script consists of a\nsequence of UI actions like *enter text 'username'* and\nthen *tap the OK button* . Robo scripts can also include actions like waiting\nfor an element to appear, tapping at a specific point within an element, and\nexecuting Android Debug Bridge (`adb`) shell commands.\n\nRobo scripts have the following advantages over traditional testing frameworks:\n\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Capability** | **Description** |\n| Highly robust | Robo scripts can tolerate significant structural and behavioral differences between app versions and app flakiness. |\n| Open-ended | After a Robo script completes, the base Robo test can take over and continue testing the app. This continued testing approach enables several key use cases. For example, you can use a Robo script to bring an app into a particular state by performing a custom sign-in flow. |\n| Recordable | You don't need to code Robo scripts manually. They can be recorded using the Robo script recorder in Android Studio. Creating or modifying Robo scripts typically doesn't require any knowledge of mobile development. |\n| Flexible | Robo scripts can interact with non-native UI elements that are common in games. |\n\nRobo scripts are conditionally triggered during a Robo test, which lets users\naugment Robo's behavior - typically to achieve greater coverage or target\nspecific functionality. In contrast to traditional testing frameworks,\nRobo scripts support the following:\n\n- Various triggering conditions, for example, a particular app package name being active (or not) or a specific element being displayed on the screen (or not).\n- Execution controls, for example, a maximum number of executions, priority, relevant crawl stage.\n- Unconventional action types (conditional, element-ignoring, screen-closing).\n\nWe recommend that you use Robo scripts whenever possible because they can be\nmaintained effortlessly. For example, you can use a Robo script to do the\nfollowing:\n\n- Navigate significant workflows to get to the core of an app's functionality. For example, you can perform a sign-in, set up an app's state after the first launch, and register a new user.\n- Focus Robo on a particular part of an app to get the most out of Robo test time. Robo script guides Robo test to reach the relevant part of an app, where Robo test resumes a fully automated crawl.\n- Bring an app into a specific state or screen to perform an analysis, for example, to analyze an in-app message, privacy policy, or specific level of a game.\n- Perform an end-to-end instrumentation test, with or without Robo test resuming a fully automated crawl after the Robo script is complete.\n\nUse more advanced Robo script features to do the following:\n\n- Perform actions before Robo starts crawling the app-under-test or after a crawl is finished, for example, clean the app-under-test data before a crawl, or change device settings.\n- Change aspects of Robo behavior during a crawl, in particular:\n - Make Robo ignore some UI widgets or app screens.\n - Provide a custom action for Robo to perform when backtracking from a particular screen.\n - Make Robo perform specific actions whenever a particular app screen is encountered during a crawl.\n- Completely customize how Robo performs a crawl. For example, use a combination of conditional and non-conditional actions to keep the app-under-test in the background throughout the crawl, while performing device manipulations and dismissing any popup dialogs that appear along the way.\n\nKeep in mind that Robo scripts don't replace all kinds of tests. You still\nneed unit tests to catch low-level logic bugs in your app; these tests\ntypically don't require an Android or iOS environment. We recommend that you\nsupplement Robo script tests with targeted instrumentation tests that can have\nspecific, detailed assertions about business logic, which are best expressed\nin code.\n\nRecord a Robo script using Test Lab in Android Studio\n\nThe Robo script recorder in Android Studio lets you record Robo scripts by\ninteracting directly with the app on your device. Follow these instructions\nto get started with Robo scripting through the Firebase tool in Android Studio:\n\n1. Open [Android Studio](https://developer.android.com/studio)\n and select **Tools -\\\u003e Firebase**.\n\n2. In the Firebase pane, click\n **Record Robo Script and Use it to Guide Robo Test**.\n\n3. Click **Record Robo script**. The Select Deployment Target dialog\n appears.\n\n4. Select the device in which you want to record the Robo script.\n\n5. After you record the Robo script in the device, save the file as a JSON file\n in the desired location.\n\n6. Open the Test Lab page in the Firebase console and upload the JSON\n script file and the application APK.\n\n7. Click the **Continue** button. You are prompted to select the device and\n API level. After the test script completes, Test Lab generates the\n test report.\n\n8. (Optional) To copy or download the logcat of the test report and the video,\n click **View Source Files**.\n\n| **Note:** Robo script recordings don't capture your actions outside the tested app. For example, sign-ins through Facebook, Twitter, and other social apps aren't recorded.\n\nBy default, Robo script robustness mechanisms prevent it from failing early.\nIf you choose the `strict` execution mode and a Robo script fails at any point,\nTest Lab abandons all further steps in the script and resumes a regular\nRobo crawl. Most often, Robo scripts fail because Robo can't find a required\nelement on the screen. To avoid failures, make sure that your app navigation is\npredictable and that your screens are shown in a deterministic order.\n\nRun a Robo script in Test Lab\n\nTo run a Robo script in Test Lab, follow these instructions:\n\n1. Open the Test Lab page in the Firebase console.\n\n2. Upload the app's APK or AAB in the **App APK or AAB field**.\n\n3. Upload your recorded or manually created Robo script file in the\n **Robo script (optional)** field.\n\nProvide a Robo script to a local Robo test run\n\nTo provide a Robo script to a local Robo test run, use the following Robo test\noption:\n\n`--robo-script-file \u003crobo-script-path\u003e`\n\nReplace `\u003crobo-script-path\u003e` with a path to your Robo script file in the local\nfile system. Follow the [instructions for a local Robo test\nrun](https://developer.android.com/training/testing/crawler).\n\nSpecify a Robo script in a gcloud CLI test invocation\n\nTo specify a Robo script in a gcloud CLI test invocation, use the following\ngcloud CLI flag: \n\n --robo-script = \u003crobo-script-path\u003e\n\nReplace `\u003crobo-script-path\u003e` with a path to your Robo script file in the local\nfile system or in Cloud Storage using `gs://` notation. For example: \n\n gcloud firebase test android run --app = \u003cpath_to_app_apk_file\u003e --robo-script = \u003crobo-script-path\u003e\n\nNext steps\n\n- To learn about Robo scripts structure, capabilities, usage, and actions, see the [Robo scripts reference guide](/docs/test-lab/android/robo-scripts-reference).\n- [Run a Robo test](/docs/test-lab/android/robo-ux-test)."]]