Robotium How to click or enter or select a file in Downloads folder on android device to open options as (Gallery, Image Gallery, Photos, ...)

Here is my code:

        String filepath = "/Downloads/";
        File file = new File(filepath +"images.jpeg" );
        Intent intent = new Intent(Intent.ACTION_VIEW);
   intent.setClassName("com.android.providers.downloads.ui", "com.android.providers.downloads.ui.DownloadList");
        Solo solo2 = new Solo(getInstrumentation(), getActivity());
        solo2.clickOnButton("Just once");

I try to run it and get error

"junit.framework.AssertionFailedError: AbsListView is not found!
at com.jayway.android.robotium.solo.Waiter.waitForAndGetView(Waiter.java:501)
at com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:450)
at com.jayway.android.robotium.solo.Clicker.clickInList(Clicker.java:430)
at com.jayway.android.robotium.solo.Solo.clickInList(Solo.java:1170)
at com.nsi.mobile.client.autotest.TestPrintQueue.testPrintfromOutside(TestPrintQueue.java:104)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)"

Help me, please. Thank all.


Your problem is because the Robotium solo could just use the classes, that you own. Maybe this solution could help for you.

| improve this answer | |

With Robotium, you only have access to activities that belong to your application. Gallery, Image Gallery, Photos, ect. launch activities that do not belong to your application.

| improve this answer | |

If you want to write tests with pre-installed apps use UIAutomator testing framework from Google: http://developer.android.com/tools/help/uiautomator/index.html

| improve this answer | |
  • That might be good information for someone who is just looking into doing the test, but are you sure this actually helps user solve the problem they're facing? Does UIAutomator integrate with Robotium? – corsiKa Mar 11 '14 at 17:25
  • 1
    You may easy add uiautomator framework library to test project. So I believe you may use Robotium and UIAutomator together – amazpyel Mar 12 '14 at 12:05

I've just had this exact problem too.

I'm running the tests on my phone (Nexus 4, 4.4.2) and I realised I got the 'junit.framework.AssertionFailedError: AbsListView is not found!' exception when my phone screen was on but locked. Yes, really.

Unlock phone => bam, test passes again.

| improve this answer | |
  • This does not provide an answer to the question – amazpyel Feb 5 '15 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.