I am switching from robotium to espresso, I am writing tests using apk, I dont have access to code. In robotium using solo.getView("view-id") we can access the view but I am not geting how to do it in espresso? espresso witId() method needs R.id.viewid which I dont have access.
public class AaEspressoTest {
private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME = "com.tri.re.CordActivity";
private static Class<?> launcherActivityClass;
static {
try {
launcherActivityClass = Class.forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
@Rule
public ActivityTestRule<?> mActivityRule = new ActivityTestRule(launcherActivityClass);
@Test public void testHello() throws Exception{
onView(withText("Browse older recordings")).perform(click());
//Id is not accessible shows red
onView(withId(R.id.button)).perform(click());
}
}