Error when clicking the first button of a Dialog

Asked

Viewed 26 times

1

Guys I’m trying to click to confirm my action on an instrumented test, but I’m having a problem that I haven’t found out yet anyone can help me? I’m trying the following:

fun clickPositiveButton(title: String) {
    checkIsDialogDisplayed(title)
    onView(withId(android.R.id.button1)).perform(click())
}

fun checkIsDialogDisplayed(title: String) {
    onView(withText(title))
        .inRoot(isDialog())
       .check(matches(isDisplayed()))
}

Trying to make that click I’m getting this error:

androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 894, 1004 and precision: 16, 16' on view 'with id: android:id/button1'.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.