I'm using Espresso to implement my application's autotest framework. But in some test-cases I've designed, I found my test always fail, and the root cause is not in my testing codes on feature implementation codes. The root cause is in the android input methods mode, sometimes, it's in Chinese input mode, and my input text is English, then the input value will fail. So I want to know how can I switch the current typeText input method mode from Chinese to English, or how could I ensure the input method mode is English without manual configuration? I believe this is an important requirement because when we support multiple languages in our applications, we need this feature to auto-switch to the needed language during testing. The following is my codes, it has no any problem if the default input mode is English.
onView(withId(R.id.entryWordInput))
.perform(typeText(entryWord), closeSoftKeyboard());
onView(withId(R.id.OkButton))
.perform(click());
Thanks in advance.