Here's a simple command to match a text field and type in a variable name.
private final String name = "foo";
onView(withId(R.id.editTextName)).perform(typeText(name));
It works fine in my application with "foo". However:
private final String name = "á";
private final String name = "\u00E1";
In both of these cases, the onView line fails, blaming inability to find a view within the previous activity's view:
android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: <myappid>:id/listViewAccounts
It seems that Espresso cannot handle Unicode characters and will fail if asked to enter them. This is running on an AVD with either the "English (US) Android Keyboard (AOSP)" or the "English (United States) Sample Soft Keyboard". The latter also flattens double letters, which is probably a separate problem with how fast Espresso enters them.
Has anyone run into this before? Is it Espresso, or the keyboard used, or something else?
I've changed the Android soft keyboard to the US International one which can long-press a to get á, but Espresso fails identically.
Update:
Using á does leave this in the stack trace (but \u00E1 doesn't):
java.lang.RuntimeException: Failed to get key events for string á (i.e. current IME does not understand how to translate the string into key events). As a workaround, you can use replaceText action to set the text directly in the EditText field.
Might be worth just doing that, although it's slightly decoupled from how the real user interaction would go.