Sorry for lots of small posts, however here's yet another - the
failing ID matches the one generated in R.java for R.id.EditText01
(I've copied the entire test (with hacks) here)
package com.my;
import java.util.ArrayList;
import com.jayway.android.robotium.solo.Solo;
import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.TextView;
/**
* @author W.Elsinga
*
*/
public class MainTest extends ActivityInstrumentationTestCase2<Main> {
private Solo solo;
private Activity activity;
/**
*
*/
public MainTest() {
super("com.my", Main.class);
}
@Override
protected void setUp() throws Exception {
super.setUp();
this.activity = this.getActivity();
this.solo = new Solo(getInstrumentation(), this.activity);
}
@Override
public void tearDown() throws Exception {
try {
this.solo.finalize();
} catch (Throwable e) {
e.printStackTrace();
}
this.activity.finish();
super.tearDown();
}
/**
* @throws Exception Exception
*/
public void testDisplay() throws Exception {
String text = "Congratulations";
//Enter "Congratulations" inside the EditText field.
this.solo.enterText(R.id.EditText01, text);
//Click on the button named "Click".
this.solo.clickOnButton("Click");
//Check to see if the given text is displayed.
assertTrue(this.solo.waitForText("Toast"));
assertTrue(this.solo.searchText("Toast"));
// TextView outputField = (TextView)
this.activity.findViewById(R.id.TextView01);
// ArrayList<TextView> currentTextViews =
this.solo.getCurrentTextViews(outputField);
// assertFalse(currentTextViews.isEmpty());
//
// TextView output = currentTextViews.get(0);
// assertEquals(text, output.getText().toString());