Forum Discussion

vikram_u_k's avatar
vikram_u_k
Contributor
9 years ago

Switch between Applications on Android

Hi Support,

   I have a question regards Appliication switching on Android.

 

I am using 11.31.2407 with a 4.4.3 Android Tablet. I have 2 Native Apk's and i would like to know how to switch between the contexts of these APK's.

 

Also the documentation lists the method TestedApps.APK.run() as entry point to start the APK. However we notice that the Application/APK is uninstalled and re-installed at the start of the test. Could this be made to just install if the Application is absent?.

 

Please list any documentation to read about the Functions/methods.

  • Hi,

     

    The most robust way to switch between the applications is to close the first application and then run the second one.

    If you want to use another approach, you can click the Task Manager button and then select the needed application from there. You can try implementing this procedure using the Image-Based Testing Principles. However, please keep in mind that this approach is not reliable, and we don't recommend to use it if you don't have a strong reason.

     

    >>>However we notice that the Application/APK is uninstalled and re-installed at the start of the test. Could this be made to just install if the Application is absent?

    For this, you need to disable the 'Deploy to the device on start' option for your application. You can find this option in the "Run-Mode Parameters" section of the TestedApps editor. Please refer to the "Installing Packages on Devices" article for more details.

  • YuriPeshekhonov's avatar
    YuriPeshekhonov
    SmartBear Alumni (Retired)

    Hi,

     

    The most robust way to switch between the applications is to close the first application and then run the second one.

    If you want to use another approach, you can click the Task Manager button and then select the needed application from there. You can try implementing this procedure using the Image-Based Testing Principles. However, please keep in mind that this approach is not reliable, and we don't recommend to use it if you don't have a strong reason.

     

    >>>However we notice that the Application/APK is uninstalled and re-installed at the start of the test. Could this be made to just install if the Application is absent?

    For this, you need to disable the 'Deploy to the device on start' option for your application. You can find this option in the "Run-Mode Parameters" section of the TestedApps editor. Please refer to the "Installing Packages on Devices" article for more details.