2016-04-11 38 views
0

UiAutomator API'mı doğrulamak için bir "UiAutometerTest" sınıfı oluşturdum.junit.framework.AssertionFailedError: Android Studio'daki UiAutomator'da test bulunamadı

public class UiAutometerTest

Testi On The Run

, ben

Koşu testleri istisna aşağıdaki alıyorum Testi koşu junit.framework.AssertionFailedError başladı 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); 
} 

} uzanır : Com.example.ajitp.myapplication.UiAutometerTesthiçbir test bulunamadı android.test.InstrumentationTestRunner.onStart (InstrumentationTestRunner.java:555) de android.test.AndroidTestRunner.runTest (AndroidTestRunner.java:191) android.test.AndroidTestRunner.runTest (AndroidTestRunner.java:176) en dede peşin android.app.Instrumentation $ InstrumentationThread.run (Instrumentation.java:1889)

Finish


Teşekkür

cevap

0

JUnit3 testleri "test" ile başlayan yöntemlerdir - örneğin: public void testFoo() .

Gördüğünüz hata, test yürütücüsünün testlere benzeyen herhangi bir yöntem bulamadığı içindir. Bir kere ekledikten sonra gider.

Not: Bu UI Otomatikçisi özgü değildir. Bu muhtemelen herhangi bir JUnit testi ile ortaya çıkabilir.

İlgili konular