I need to do some auto testing jobs to an Android application without its source code. I found both robotium and espresso can do this job, I decided to use espresso because its
I didn't clearly understand what did you mean under
... Android application without its source code.
but why can't you call activity from the test class without reflection? Just how it was shown in Espresso Start Guide.
You have activity and appropriate test, take a look at the package, imported classes, extended class and constructor in those examples. I mean smth like this:
package com.google.android.apps.common.testing.ui.espresso.tests;
import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData;
<...>
import com.google.android.apps.common.testing.ui.testapp.R;
import com.google.android.apps.common.testing.ui.testapp.SimpleActivity;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
@LargeTest
public class BasicTest extends ActivityInstrumentationTestCase2 {
public BasicTest() {
super(SimpleActivity.class);
}
@Override
public void setUp() throws Exception {
super.setUp();
getActivity();
}
<...>