Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChooserActivity is not found with Robotium testing while ChooserActivity is showing on Nexus 5

I start developing a Android Project. I am writing testsuites. I want to test showing ChooserActivity. When I used a LG g2 tests are passed. However When I used a Nexus 5 (Lollipop) tests are failed.

Code is as following:

public void testRun() {
    int timeout = 5;

    // Wait for activity: 'course.labs.intentslab.ActivityLoaderActivity'
    assertTrue("course.labs.intentslab.ActivityLoaderActivity is not found!",
            solo.waitForActivity(course.labs.intentslab.ActivityLoaderActivity.class));

    // Click on Implicit Activation
    solo.clickOnView(solo
            .getView(course.labs.intentslab.R.id.implicit_activation_button));
    // Wait for activity: 'com.android.internal.app.ChooserActivity'
    assertTrue("ChooserActivity is not found!",
            solo.waitForActivity("ChooserActivity"));
    // Click on MyBrowser
    solo.clickInList(2, 0);
}

Nexus ScreenShot:

enter image description here

LG G2 ScreenShot:

enter image description here

When test run on Nexus error is given which is as following

Running tests
Test running started
junit.framework.AssertionFailedError: ChooserActivity is not found!

How Can I proceed? Why Chooser Activty is not found on Nexus 5?

like image 935
Burak Dağlı Avatar asked Jan 20 '15 13:01

Burak Dağlı


1 Answers

Unfortunately, you will need to choose a Galaxy Nexus AVD emulator with API level 18( and not Lollipop - API level 21) . To view the available target devices and their API levels in Eclipse, goto Run --> Run configurations , and click the Target tab on the right pane. Hope this helps

like image 154
bit2 Avatar answered Sep 30 '22 08:09

bit2