با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Firebase Test Lab زیرساخت های مبتنی بر ابر را برای آزمایش برنامه های اندروید ارائه می دهد. این سند نحوه شروع کار با Test Lab را با استفاده از کنسول Firebase شرح می دهد.
Test Lab به شما امکان می دهد انواع تست های زیر را اجرا کنید:
تست ابزار دقیق : تستی که می نویسید و به شما امکان می دهد رابط کاربری برنامه خود را با اقداماتی که مشخص می کنید هدایت کنید. یک آزمایش ابزار دقیق همچنین میتواند اظهارات صریحی درباره وضعیت برنامه شما برای تأیید عملکرد صحیح با استفاده از AndroidJUnitRunnerAPIs داشته باشد. Test Lab از چارچوب های تست ابزار دقیق Espresso و UI Automator پشتیبانی می کند.
تست Robo : تستی که رابط برنامه شما را تحلیل میکند و سپس با شبیهسازی فعالیتهای کاربر، آن را بهطور خودکار بررسی میکند.
تست حلقه بازی : آزمایشی که از "حالت نمایشی" برای شبیه سازی اقدامات بازیکن در برنامه های بازی استفاده می کند.
قبل از شروع
پروژه Firebase شما باید در طرح قیمتگذاری Blaze باشد، به این معنی که پروژه شما به یک حساب Cloud Billing مرتبط است. می توانید در کنسول Firebaseبه طرح قیمت گذاری Blaze ارتقا دهید . برای پیوند دادن یک حساب Cloud Billing ، باید مالک یا ویرایشگر پروژه خود باشید.
مرحله 1. یک پروژه Firebase ایجاد کنید
اگر هنوز این کار را نکرده اید، به کنسول Firebase بروید و یک پروژه Firebase جدید ایجاد کنید.
مرحله 2. آزمایشی را اجرا کنید
تست ابزار دقیق
در نوار پیمایش کنسول Firebase ، روی Test Lab کلیک کنید و سپس روی Get Started -> Run an Instrumentation test کلیک کنید.
روی Browse کلیک کنید و سپس به APK یا AAB برنامه خود بروید و قبل از کلیک کردن روی Continue APK یا AAB را آزمایش کنید.
ماتریس تست خود را با انتخاب دستگاهها، سطوح API Android، جهتگیری صفحه و مناطقی که میخواهید برنامه خود را بر اساس آن آزمایش کنید، تعریف کنید. فقط میتوانید ترکیبهای سطح دستگاه و API Android را که میخواهید برای آزمایش هدف قرار دهید، انتخاب کنید.
(اختیاری) روی Show advanced options کلیک کنید تا زمان تست که حداکثر مدت اجرای هر آزمون را تعیین می کند، تغییر دهید.
(اختیاری) برای کمک به شناسایی و مکان یابی ماتریس های آزمایشی خود در کنسول Firebase ، می توانید با وارد کردن نام برچسب در قسمت برچسب ماتریس تست (اختیاری) یک برچسب به ماتریس آزمایشی خود اضافه کنید.
روی Start N Tests کلیک کنید، جایی که "N" تعداد تنظیمات آزمایشی معتبر از ماتریس آزمایشی است که در این صفحه تعریف میکنید. هر تست در انتظار زمانی که در انتظار اجراست با یک نماد ساعت آبی نشان داده میشود و پس از اتمام تست، این نماد به نماد چک سبز تغییر میکند.
پس از اجرای هر آزمایش، روی دستگاه فهرست شده در ستون اجرای آزمایش کلیک کنید تا نتایج آزمایش شامل موارد آزمایش، گزارشها، تصاویر صفحه و ویدیوها را ببینید.
تست روبو
در نوار پیمایش کنسول Firebase ، روی Test Lab کلیک کنید و سپس روی Get Started -> Run a Robo test کلیک کنید.
روی Browse کلیک کنید، به APK برنامه خود بروید و سپس روی Continue کلیک کنید.
ماتریس تست خود را با انتخاب دستگاهها، سطوح API Android، جهتگیری صفحه و مناطقی که میخواهید برنامه خود را بر اساس آن آزمایش کنید، تعریف کنید.
(اختیاری) برای تغییر گزینه های زیر روی Show advanced options کلیک کنید:
زمان تست حداکثر مدت زمان اجرای هر آزمون را تعیین می کند.
اعتبار حساب آزمایشی برای ارائه اعتبار برای یک حساب آزمایشی استفاده می شود.
فیلدهای اضافی برای ارائه ورودی متن برای سایر فیلدهای متنی در برنامه شما استفاده می شود.
(اختیاری) برای کمک به شناسایی و مکان یابی ماتریس های آزمایشی خود در کنسول Firebase ، می توانید با وارد کردن نام برچسب در قسمت برچسب ماتریس تست (اختیاری) یک برچسب به ماتریس آزمایشی خود اضافه کنید.
روی Start N Tests کلیک کنید، جایی که "N" تعداد تنظیمات آزمایشی معتبر از ماتریس آزمایشی است که در این صفحه تعریف میکنید. هر آزمون معلق در حالی که در انتظار اجراست با یک نماد ساعت آبی نشان داده می شود و پس از اتمام تست آن نماد به یک بررسی سبز رنگ تغییر می کند.
پس از اتمام اجرای هر آزمون، روی دستگاه فهرست شده در ستون اجرای آزمایش کلیک کنید تا نتایج آزمایش شامل موارد آزمایش، گزارشها، تصاویر صفحه و ویدیوها را ببینید.
در صفحه Test Labکنسول Firebase ، روی Run Your First Test > Run an Android Game Loop کلیک کنید.
در بخش آپلود برنامه ، روی مرور کلیک کنید، سپس فایل APK برنامه خود را انتخاب کنید (اگر قبلاً این کار را نکرده اید، یک فایل APK برای برنامه خود ایجاد کنید ).
(اختیاری) برای کمک به شناسایی و مکان یابی ماتریس های آزمایشی خود در کنسول Firebase ، می توانید با وارد کردن نام برچسب در قسمت برچسب ماتریس تست (اختیاری) یک برچسب به ماتریس آزمایشی خود اضافه کنید.
(اختیاری) اگر می خواهید چندین حلقه یا سناریو را همزمان اجرا کنید، یا حلقه های خاصی را برای اجرا انتخاب کنید، اعداد حلقه ها را در قسمت سناریوها وارد کنید.
به عنوان مثال، وقتی "1-3، 5" را وارد می کنید، Test Lab حلقه های 1، 2، 3 و 5 را اجرا می کند. به طور پیش فرض (اگر چیزی در قسمت سناریوها وارد نکنید)، Test Lab فقط حلقه 1 را اجرا می کند.
در بخش Devices ، یک یا چند دستگاه فیزیکی را که میخواهید برنامه خود را روی آن آزمایش کنید، انتخاب کنید، سپس روی Start Tests کلیک کنید.
مرحله 3. نتایج آزمایش خود را بررسی کنید
هنگامی که آزمون شروع می شود، به طور خودکار به صفحه نتایج آزمون هدایت می شوید. بسته به تعداد پیکربندیهای مختلفی که انتخاب کردهاید و مدت زمان تست تعیینشده برای تستهایتان، ممکن است چند دقیقه اجرا شوند. پس از اجرای آزمایشات، می توانید نتایج آزمون را بررسی کنید. برای کسب اطلاعات بیشتر در مورد نحوه تفسیر نتایج آزمایش، به تجزیه و تحلیل نتایج Firebase Test Lab مراجعه کنید.
تاریخ آخرین بهروزرسانی 2025-08-15 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-15 بهوقت ساعت هماهنگ جهانی."],[],[],null,["\u003cbr /\u003e\n\nFirebase Test Lab provides cloud-based infrastructure for testing\nAndroid apps. This document describes how to get started with Test Lab using the\nFirebase console.\n\nTest Lab lets you run the following types of tests:\n\n- [Instrumentation test](/docs/test-lab/android/instrumentation-test):\n A test you write that allows you to drive the UI of your app with the actions\n you specify. An instrumentation test can also make explicit assertions about\n the state of your app to verify correct functionality using\n [AndroidJUnitRunnerAPIs](https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner). Test Lab supports\n [Espresso](https://developer.android.com/training/testing/espresso)\n and\n [UI Automator](https://developer.android.com/training/testing/other-components/ui-automator) instrumentation test frameworks.\n\n- [Robo test](/docs/test-lab/android/robo-ux-test):\n A test that analyzes your app's interface and then explores it automatically\n by simulating user activities.\n\n- [Game loop test](/docs/test-lab/android/game-loop): A test\n that uses a \"demo mode\" to simulate player actions in game apps.\n\nBefore you begin\n\nYour Firebase project must be on the [pay-as-you-go Blaze pricing plan](/pricing), which means that\nyour project is linked to a Cloud Billing account. You can\n[upgrade to the Blaze pricing plan](//console.firebase.google.com/project/_/overview?purchaseBillingPlan=metered)\nin the Firebase console. You need to be an Owner or Editor for your project\nto link a Cloud Billing account.\n\nStep 1. Create a Firebase project\n\nIf you haven't yet, go to the [Firebase console](https://console.firebase.google.com/)\nand create a new Firebase project.\n| **Note:** If you're working on a shared Firebase project, you'll need to have ownership or edit permissions for the project.\n\nStep 2. Run a test \n\nInstrumentation test**Note:** If you want to run an instrumentation test with [Android Test Orchestrator](https://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator), see [Enable Orchestrator](/docs/test-lab/android/instrumentation-test#orchestrator).\n\n1. On the [Firebase console](https://g.co/firebase) navigation bar,\n click **Test Lab** , and then click **Get Started -\\\u003e Run an Instrumentation\n test**.\n\n2. Click **Browse** , and then browse to your app APK or AAB and test APK or\n AAB before clicking **Continue**.\n\n3. Define your test matrix by selecting which devices, Android API levels,\n screen orientations and locales you want to test your app against. You can\n select only those device and Android API level combinations that you want\n to target for testing.\n\n4. (Optional) Click **Show advanced options** to change the Test timeout\n that determines the maximum duration of each test execution.\n\n5. (Optional) To help you identify and locate your test matrices in the\n Firebase console, you can add a label to your test matrix by entering a\n label name in the **Test matrix label (optional)** field.\n\n6. Click **Start *N* Tests**, where \"N\" is the number of valid test\n configurations from the test matrix that you define on this screen. Each\n pending test is shown with a blue clock icon while it is waiting to run,\n and that icon changes to a green check icon when the test has completed.\n\n7. After each test has run, click the device listed in the Test Execution\n column to see test results, including test cases, logs, screenshots and\n videos.\n\nRobo test\n\n1. On the [Firebase console](https://g.co/firebase) navigation bar,\n click **Test Lab** , and then click **Get Started -\\\u003e Run a Robo test**.\n\n2. Click **Browse** , browse to your app APK, and then click **Continue**.\n\n3. Define your test matrix by selecting which devices, Android API levels,\n screen orientations and locales you want to test your app against.\n\n4. (Optional) Click **Show advanced options** to change the following options:\n\n - Test timeout determines the maximum duration of each test execution.\n - Test account credentials are usedis used to provide credentials for a test account.\n\n | **Caution:** Never use this option with real user accounts.\n - Additional fields are used to provide text input for other text fields in your app.\n\n | **Note:** To learn more about Test account credentials and additional fields, see [Test account sign-in and predefined text](/docs/test-lab/robo-ux-test#test_account_sign-in_and_predefined_text_input).\n5. (Optional) To help you identify and locate your test matrices in the\n Firebase console, you can add a label to your test matrix by entering\n a label name in the **Test matrix label (optional)** field.\n\n6. Click **Start *N* Tests**, where \"N\" is the number of valid test\n configurations from the test matrix that you define on this screen. Each\n pending test is shown with a blue clock icon while it is waiting to run,\n and that icon changes to a green check when the test has completed.\n\n7. After each test finishes running, click the device listed in the Test\n Execution column to see test results, including test cases, logs,\n screenshots and videos.\n\nIf you want to create a script to guide the Robo test, see\n[Record a Robo script using Test Lab in Android Studio](/docs/test-lab/android/run-robo-scripts#record-android-studio).\n\nGame Loop test\n\n1. On the Test Lab page of the [Firebase console](https://console.firebase.google.com/project/_/%0Atestlab), click **Run Your First Test \\\u003e Run an Android Game Loop**.\n\n2. In the **Upload App** section, click **Browse** , then select your app's\n APK file (if you haven't already, [generate an APK file](https://firebase.google.com/docs/test-lab/android/game-loop#run-testlab) for your app).\n\n3. (Optional) To help you identify and locate your test matrices in the\n Firebase console, you can add a label to your test matrix by entering\n a label name in the **Test matrix label (optional)** field.\n\n4. (Optional) If you want to run multiple loops or scenarios at a time, or\n select specific loops to run, enter the loop numbers in the\n **Scenarios** field.\n\n For example, when you enter \"1-3, 5\", Test Lab runs loops 1, 2, 3, and 5.\n By default (if you don't enter anything in the **Scenarios** field),\n Test Lab only runs loop 1.\n5. In the **Devices** section, select one or more physical devices you\n want to test your app on, then click **Start Tests**.\n\nStep 3. Investigate your test results\n\nWhen the test starts, you're automatically redirected to the test results page.\nTests can take a number of minutes to run, depending on the number of different\nconfigurations you have selected and the test timeout duration set for your\ntests. After your tests have run, you can review test results. See\n[Analyzing Firebase Test Lab Results](/docs/test-lab/android/analyzing-results) to learn more\nabout how to interpret the test results.\n| **Note:** For all test types, any uncaught exception will cause a test failure."]]