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

Posted on January 25, 2016, in Education and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: