TestProject Forum
Powered by leading experts in the test automation community

Switching between different mobile applications during a test

Hello, i need guidance on how to work with the ‘Get current activity’ parameters. I am trying to access a different application during my mobile tests, and i need to have it switch to its current state rather than resetting.

Hi @derrick!

To be able to switch between Android applications and return to the same activity, you need to do as follow:

  1. Use the “Get Current Activity” action. Store the result of this action in an output parameter so that you’ll be able to use it later.

  2. Use the “Start Activity” action to switch to the other application. You will have to provide the other application’s package and activity:

  3. Once you finished with the other application and you want to return to the first application, use the “Start Activity” action again and state the activity you stored inside the input parameter in step number 1.

Hope it all makes sense :slight_smile:

Let me know if you have further questions.


Thanks this is very resourceful.
More clarification needed. Kindly explain how you retrieve and store this results of the action in the output parameter.

You create a new output parameter and choose it. The result of this step will be stored there. Then, you can choose this parameter in the activity field.

1 Like