zhangmengvv / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

NoMatchingViewException from View id #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes I get NoMatchingException when I try to perform doble click over a 
view (button) in this way:
'Espresso.onView(ViewMatchers.withId(R.id.main_menu_select_account))
.perform(ViewActions.doubleClick());    '

I understand for this exception that the view is not available but the view is 
visible because I can press manually the button.
For complete stacktrace I attach log.

Original issue reported on code.google.com by 1989...@gmail.com on 9 Jul 2014 at 10:35

Attachments:

GoogleCodeExporter commented 9 years ago
Please paste the exception in here.

Original comment by vale...@google.com on 14 Jul 2014 at 5:02

GoogleCodeExporter commented 9 years ago
The trace is already attached in first review, I'm using this:

        for (int i = 0; i < Constants.CLICK_RETRIES; i++) {
            try {
                Espresso.onView(ViewMatchers.withId(id)).perform(
                        ViewActions.clearText());
                break;
            } catch (Throwable e) {
                SystemClock.sleep(Constants.ACTION_WAIT);
                log.debug("Retry {}", i);
            }
        }

I wonder if have another solution more efficient for this problem.

Original comment by 1989...@gmail.com on 15 Jul 2014 at 8:01

GoogleCodeExporter commented 9 years ago
Don't feel like opening a random .applescript file. :)

I'm going to guess that your doubleClick is turned into a regular click due to 
some lag between the motion down events. If this is indeed the case, there's 
not much we can do.

Original comment by vale...@google.com on 19 Nov 2014 at 10:21