2

I am using Bitrise to run some Android espresso UI tests, but I cant seem to find a solution for this Perform Exception:

android.support.test.espresso.PerformException: Error performing 'single click' on view 'with id: com.selfcarecatalyst.healthstorylines.adda:id/male'.
    at android.support.test.espresso.PerformException$Builder.build(PerformException.java:83)

Im testing a sign up page that has a few fields. If i skip clicking one field, I get the same error on the next click on this form. The relevant code is:

public void clickMale_onInfoPage(){

    onView(withId(R.id.male)).perform(click());
}
public void setFirstName_onInfoPage(String name){
    onView(withId(R.id.first_name)).perform(typeText(name));
    closeSoftKeyboard();
}

setName is called first, and i added a softclosekeyboard thinking this would solve it but it did not :(

This is running through a CI, and sorry but Im a little new and not sure how to get a better error message/stacktrace. Any help would be much appreciated!

1ak31sha
  • 501
  • 7
  • 18
  • I am still not able to get it into work but I'll publish a how to as soon I get it into work. The first thing you need to do is to make sure your test is working on your laptop. Then on Bitrise add `create android emulator` and `start android emulator` from stack. after that you must add script in order to move apk-s to emulator and run Espresso. you can follow my progress at http://stackoverflow.com/q/36753486/513413 – Hesam Apr 20 '16 at 21:51
  • sure il check it out thanks! my test works locally, the issues only happen on CI and it is hard to debug – 1ak31sha Apr 21 '16 at 23:07

1 Answers1

0

You should also try to call closeSoftKeyboard() before performing the click action.

  • Right before the perform click call? `public void clickMale_onInfoPage(){ closeSoftKeyboard(); onView(withId(R.id.male)).perform(click()); }` – jordifierro Apr 25 '16 at 15:29