Is there a way to record a RoboScript for just one activity in Android Studio?

Viewed 88

I am working on an Android application and need to test it with multiple logins on Firebase Test Lab. This is part of the flow of the application at the moment:

  • Intro Screen with "Sign Up" and "Log In".
  • Login Activity.
  • OnBoarding/First Walkthrough Activity.
  • Main Activity.

I would like to begin the RoboScript recording at the third Activity (OnBoarding). There is some content in that activity that only a RoboScript can get through properly.

The goal is to:

  • Let the RoboTest select "Log In" on the Intro Screen on its own (with no RoboScript involvement).
  • RoboTest uses login info from "Presets" section in Test Lab to log in (still no RoboScript involvement).
  • RoboTest then uses RoboScript to get through just the OnBoarding Activity.
  • Main Activity (no RoboScript involvement here).

Anytime I select the option to begin recording the RoboScript in Android Studio however, Android Studio restarts the application and begins recording from the first Activity (Intro Screen with "Sign Up" and "Log In").

Is there a way to make Android Studio begin recording a RoboScript at a certain Activity? Thanks.

1 Answers

By checking "Enable test fragment recording" in File -> Settings -> Build, Execution, Deployment [-> Testing] -> Espresso Test Recorder, you will get a top center button in the Recorder dialog that will allow you to stop/resume recording of your Roboscript at any point. You can also tweak other parameters of the Recorder on the same Settings page, e.g., whether it should clear the app's data before/after recording.

Alternatively, you can record your Roboscript from the very beginning and then manually remove any recorded actions preceding the OnBoarding activity.

Related