Monthly Archives: January 2016

android.support.test.espresso.PerformException: Error performing ‘single click’

I encounter the following exception while writing the Espresso test case which involve entering text into edittext component. From what I can tell is the window loses focus and system cant find the next view for action that needs to be process. As a result, after I tell the Espresso framework to enter text, I post a closeKeyboard api to the same edittext so it can be close and Espresso framework able to find the next onView ID.

Error:
android.support.test.espresso.PerformException: Error performing ‘single click’….

Workaround: onView(withId(R.id.edittext_username)).perform(clearText(),typeText(“xxxxx”));
onView(withId(R.id.edittext_username)).perform(closeSoftKeyboard());
Thread.sleep(1000);
//…. next edittext entry

* Please post comments if anyone has a better solution to this.

Advertisements