Switch to Default App from another app

Hi Dear,

can any one support me on below:

I am doing mobile testing using appium python selenium combination.

My scenario is

When launch the mobile there will be opened home screen first
then automatically one app will install
Then I will perform some action in the same app
then I will search something in Search box
then I will click on Search button
then I will be redirecting me to the chrome browser automatically
then I will perform some scroll on the same page in chrome
then I need to switch back the application.

Kindly help me

  1. Close browser with close button available.
  2. Choose return to app button. Such button often exists when browser was opened by other program.
  3. Terminate browser
  4. Activate your app again with avtivate command
  5. Depending on your OS e.g. with Android you can tap swith button and scroll to your app
  6. Close all and tap icon on phone witb your app

hi can you help me with sample code please

Example with activateApp

// Java
((InteractsWithApps) driver).activateApp(appID);

thanks aleksei for you help, I am looking for python code

Well we have


And look here