Skip to content Skip to sidebar Skip to footer

Espresso Throw " Error Performing 'single Click' On View” When It Run On Device In The Cloud, But Same Test Successfully Run Locally

I fill up user name and password and press a button that sends the information over the network (Espresso Idling resource is implemented), in the application the next screen appear

Solution 1:

Usually this kind of error appears when you are working on a screen whose fields are hidden behind the soft keyboard. Thus, you should do a couple of things:

  1. Make the layout scrollable and using ViewActions.scrollTo perform the scroll to that field.
  2. Close que soft keyboard using ViewActions.closeSoftKeyboard

An example:

String OLD_PWD_INPUT = "Asdf1234;";
onView(withId(R.id.old_password)).perform(typeText(OLD_PWD_INPUT));
onView(withId(R.id.verify_new_password)).perform(closeSoftKeyboard());
onView(withId(R.id.change_password_button)).check(matches(not(isEnabled())));

String NEW_PWD_INPUT = "Asdf1235;";
onView(withId(R.id.new_password)).perform(scrollTo());
onView(withId(R.id.new_password)).perform(typeText(NEW_PWD_INPUT));
onView(withId(R.id.verify_new_password)).perform(closeSoftKeyboard());
onView(withId(R.id.change_password_button)).check(matches(isEnabled()));

Post a Comment for "Espresso Throw " Error Performing 'single Click' On View” When It Run On Device In The Cloud, But Same Test Successfully Run Locally"