0
votes

I have created a "UiAutometerTest" class as follow to verify my UiAutomator API.

public class UiAutometerTest extends InstrumentationTestCase{

private UiDevice device;
@Override
protected void setUp() throws Exception {
    super.setUp();
    device = UiDevice.getInstance(getInstrumentation());
    device.pressHome();
    // Wait for the Apps icon to show up on the screen
    device.wait(Until.hasObject(By.desc("Apps")), 3000);
    UiObject2 appsButton = device.findObject(By.desc("Apps"));
    appsButton.click();
    // Wait for the ResMed icon to show up on the screen
    device.wait(Until.hasObject(By.text("My Application")), 3000);
    UiObject2 SplusApp = device.findObject(By.text("My Application"));
    SplusApp.click();
    assertTrue(true);
}

}


On Test Run, I am getting following exception

Running tests Test running started junit.framework.AssertionFailedError: No tests found in com.example.ajitp.myapplication.UiAutometerTest at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1889)

Finish


Thanks in advance

1

1 Answers

0
votes

JUnit3 tests are methods that start with "test" - for example: public void testFoo().

The error you're seeing is because the test runner didn't find any methods that look like tests. It will go away once you add some.

Note: This isn't UI Automator specific. This probably can occur with any JUnit test.