How to handle the external activity of an application in android using robotium

I am trying to automate an Android application (relocation services) using robotium. This application has a multimedia section, as well as electronic and telephone numbers for dialing, so when I click on any of these options (video, audio, phone, e-mail), you get into the native application (video, audio, phone, Email) Phone. So, how to handle the external activity of the application using robotium (for example, click the "Back" button to return to my application, or close the native camera or video application to return to my application)

Any answer would be a big help.

+4
source share
3 answers

I think using Robotium , you cannot access other application resources from the target testing application.

Just use Instrumentation for this,

 Instrumentation inst = new Instrumentation(); inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK); 

But be sure that if you do this in an Activity , then put it in a separate thread to run this code.

0
source

You can only access your own application within the framework of the toolkit. There are several options:

+2
source

Sorry this is ...

I just launched the stub and gallery that I made / used in the game store ... I thought maybe it’s useful for you / others to test the camera and gallery in automated tests.

https://play.google.com/store/apps/details?id=com.hitherejoe.CameraStub&hl=en

https://play.google.com/store/apps/details?id=com.hitherejoe.GalleryStub&hl=en_GB

+2
source

Source: https://habr.com/ru/post/1401304/


All Articles