Open In App

How to Use Test Lab Console in Firebase?

Last Updated : 21 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

With the help of Firebase Test Lab, a cloud-based app testing infrastructure, you can test your app across a variety of platforms and setups to better understand how it will function when used by actual users. For those who are unfamiliar, Firebase Test Lab is a platform for testing apps on the cloud. You can test your Android and iOS applications on a range of hardware configurations with a single operation, and you can view the results in the Firebase console along with logs, videos, and images. Have you ever been concerned that you wouldn’t have the actual device to fix a device-specific crash in production? you were captured by Firebase Test Lab. In order to identify issues that only arise on particular devices and configurations, Test Lab runs your app on hardware that is installed and active in a Google data center.

Let’s see how it works in action!

On Android apps, Test Lab runs tests using UI Automator 2.0 and Espresso. Use one of those frameworks to create tests, then execute them using the cloud command-line interface or the Firebase console. Your app will be tested on real, operational hardware in a Google data center by Test Lab. 

The devices have changeable localization settings and updated APIs installed on them, enabling you to road-test your app on the hardware and configurations it will come across in everyday use. You may even have Test Lab use automated Robo tests to construct the tests for you if you’re just testing on Android.

What does Firebase Test Lab Offer

The firebase test suite like all the other products includes a wide range of key features, we will now discuss this in detail

Particulars

Features

Check out the iOS and Android applications. Conduct tests on a variety of Android and iOS devices that Test Lab is hosting.
Run on actual hardware. In order to identify issues that only arise on particular devices and configurations, Test Lab runs your app on hardware that is installed and active in a Google data center.
incorporating workflow. The Firebase console, Android Studio, and the Gcloud CLI are all integrated with Test Lab. Additionally, Continuous Integration (CI) systems can be used with it.

This is the wide range of features that Firebase Test Lab offers you, you can always leverage this, with other Firebase services, you can connect multiple services and then use it when you want.

How to Add Test Lab Console to your Project?

Step #1: Add Firebase to your app

The first and foremost step you need to take is, to attach your project to Firebase, connecting your app to Firebase.

Image #1: The testing page

Image #1: The testing page

Step #2: Add the SDK to your app

You need to add the Firebase SDK to your app, you can now add classpaths to your Android Gradle Build, just copy and paste the below-mentioned lines in your Gradle file and build your app like you normally do.

classpath 'com.google.gms:google-services:4.3.4'

Step #3: Add the apex file to the module

apply plugin: 'com.google.gms.google-services'

That’s it, with this you have added Test Lab to your project, let’s put it on a run, open the Project window, then right-click a test and select 

  • Run from the menu that appears.
  • Right-click a class or method in the test file and select Run to run all of the methods in that class.
  • Right-click the directory and choose to Execute tests to run every test it contains.

The Android Plugin for Gradle produces a test APK and a production APK, installs both APKs on the connected device or emulator, and executes the tests. The instrumented test code is located in the default directory (src/androidTest/java/). The outcomes of the instrumented test execution are then shown by Android Studio in the Run pane.

Image #2: The selecting pane.

Image #2: The selecting pane.

After the testing has been completed you will get to have a detailed summarised report.

Image #3: The actual test result.

Image #3: The actual test result.

Conclusion

The regular Spark and Blaze pricing plans include a Cloud API quota and a testing quota from Firebase Test Lab.
Test Lab quotas are assigned to projects rather than individual sites. All test types (instrumentation, Robo, and Game Loop) and test matrices use the same limits. Each device’s run times are shown next to it. The test run times are utilized for billing if you are a member of the Blaze plan. In the Firebase console, under Test execution and test matrix results, you can view a test’s run time, or the amount of time it takes to run.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads