espresso-test-lib/EspressoInstrumentation/src/com/tomtom/espresso/test/CucumberHelperTestSteps.java
public static void pressButtonWithTextOnce(final String buttonText) {
        try {
            onView(withText(buttonText)).perform(click());
        } catch (final junit.framework.AssertionFailedError e) {
            // When item to click has to be asynchronously loaded in UI from adapter
            onData(hasToString(equalToIgnoringCase(buttonText))).perform(click());
        } catch (final NoMatchingViewException e) {
            // When item to click has to be asynchronously loaded in UI from adapter
            onData(hasToString(equalToIgnoringCase(buttonText))).perform(click());
        } catch (final RuntimeException e) {
            // When item to click has to be asynchronously loaded in UI from adapter
            onData(hasToString(equalToIgnoringCase(buttonText))).perform(click());
        }
    }
/**
     * Try to press a button with some text or load button if it's in adapter
     * This doesn't guarantee the button is visible to the user, for example:
     * user needs to scroll down to press button
     *
     * @param buttonText
     *            Text of the button to press
     */
Try to press a button with some text or load button if it's in adapter
This doesn't guarantee the button is visible to the user, for example:
user needs to scroll down to press button

@param buttonText
Text of the button to press
Try to press a button with some text or load button if it ' s in adapter This doesn ' t guarantee the button is visible to the user for example : user needs to scroll down to press button @param buttonText Text of the button to press
public static void pressButtonWithTextOnce(final String buttonText) {
        try {
            onView(withText(buttonText)).perform(click());
        } catch (final junit.framework.AssertionFailedError e) {
            onData(hasToString(equalToIgnoringCase(buttonText))).perform(click());
        } catch (final NoMatchingViewException e) {
            onData(hasToString(equalToIgnoringCase(buttonText))).perform(click());
        } catch (final RuntimeException e) {
            onData(hasToString(equalToIgnoringCase(buttonText))).perform(click());
        }
    }
public static void pressButtonWithTextOnce ( final String buttonText ) { try { onView ( withText ( buttonText ) ) . perform ( click ( ) ) ; } catch ( final junit . framework . AssertionFailedError e ) { onData ( hasToString ( equalToIgnoringCase ( buttonText ) ) ) . perform ( click ( ) ) ; } catch ( final NoMatchingViewException e ) { onData ( hasToString ( equalToIgnoringCase ( buttonText ) ) ) . perform ( click ( ) ) ; } catch ( final RuntimeException e ) { onData ( hasToString ( equalToIgnoringCase ( buttonText ) ) ) . perform ( click ( ) ) ; } }
Try to press a button with some text or load button if it's in adapter
 This doesn't guarantee the button is visible to the user, for example:
 user needs to scroll down to press button
Try to press a button with some text or load button if it ' s in adapter This doesn ' t guarantee the button is visible to the user for example : user needs to scroll down to press button
// When item to click has to be asynchronously loaded in UI from adapter // When item to click has to be asynchronously loaded in UI from adapter // When item to click has to be asynchronously loaded in UI from adapter