Robotium How to click or enter or select a file in Downloads
folder on android device to open options as (Gallery, Image Gallery, Photos, etc
)
Here is my code:
String filepath = "/Downloads/";
File file = new File(filepath +"images.jpeg" );
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.android.providers.downloads.ui", "com.android.providers.downloads.ui.DownloadList");
getInstrumentation().getContext().startActivity(intent);
setActivityIntent(intent);
Solo solo2 = new Solo(getInstrumentation(), getActivity());
solo2.getCurrentViews();
assertNotNull(solo2);
solo2.clickInList(1);
solo2.sendKey(solo2.ENTER);
solo2.waitForDialogToOpen(10000);
solo2.clickInList(1);
solo2.clickOnButton("Just once");
....
I try to run it and get the next 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)"
Any ideas?