Use:
sendKeys("SHIFT_LEFT T E S T SHIFT_LEFT T R I P");
instead of
sendKeys("TestTrip");
On Aug 10, 5:39 pm, Ab Caballero <[email protected]> wrote:
> I have a fairly simple Test Project that tests the user interface of
> an activity. My problem is that it fails toward the end of the test
> and i don't know why.
>
> 1) The preconditions for getActivity(), the buttons and view pass
> 2) The test that the view is visible passes
> 3) The test that the view is empty when presented to the user passes
> 4) The test that text CAN be entered into the view FAILS.
>
> private static final String TRIP_RESULT = "TestTrip";
> .
> .
> .
> mEditTextTripName = (EditText)
> mActivity.findViewById(R.id.EditTextTripName);
> .
> .
> .
> @SmallTest
> public void testViewFull(){
> mEditTextTripName.clearComposingText();
> TouchUtils.tapView(this, mEditTextTripName);
> sendKeys("TestTrip");
> String tripName = mEditTextTripName.getText().toString();
> assertEquals("The trip name should be:", TRIP_RESULT,
> tripName);
>
> }
>
> The test fails on assertEquals(), with the following error message:
>
> junit.framework.ComparisonFailure: The trip name should be:
> expected:<TestTrip> but was:<>
>
> Any thoughts are appreciated.
--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en