lundi 20 juillet 2015

Android Espresso black-box testing

Dose anyone try to do black-box testing with Android Espresso?

Could anyone provides me with some simple example?

I had tried some example before, but failed every time!

Example, I had tried this one:

public class ApplicationTest extends ActivityInstrumentationTestCase2
{

private static final String ACTIVITY_CLASSNAME = "com.example.kai_yu.blackboxtest";

private static Class launchActivityClass;
static
{
    try
    {
        launchActivityClass = Class.forName(ACTIVITY_CLASSNAME);
    }
    catch (ClassNotFoundException e)
    {
        throw new RuntimeException(e);
    }
}

public ApplicationTest()
{
    super(launchActivityClass);
}

@Test
public void testClick()
{

}

}

But Android Studio said:

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.kai_yu.blackboxtest"

com.example.kai_yu.blackboxtest is applicationId which is another installed application on my phone

Thank you!

Aucun commentaire:

Enregistrer un commentaire