"Timeout Waiting for task." when trying to click on webview button with espresso android

Asked

Viewed 146 times

1

I have a button on a mdl-card of an html page that is as follows:

<div class="mdl-layout-spacer"></div> <a id="btn15-minutos" href="#/" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored dialog-button">Comprar</a>

I have an android application that accesses this page using the Browserview component. I am using espresso to perform automated tests in this app, and I need that during the test, the button of this page be clicked inside the webview, and for this I used the following codes:

onWebView().perform(script("return document.getElementById(\"btn15-minutos\").click()"));

and

onWebView(withId(R.id.webview)).withElement(findElement(Locator.ID, "btn15-minutos")).perform(webClick());

But both are presenting the same error:

java.lang.Runtimeexception: java.util.Concurrent.Timeoutexception: Timeout Waiting for task.

And on Android Monitor:

I/Viewinteraction: Performing 'Evaluate Atom: android.support.test.espresso.web.model.Transformingatom@869757 in window: null with element: null' action on view with id: com.projecto.android:id/webview

Does anyone know a solution or have you been there? Thank you

1 answer

1


Problem solved, had modified the function getUrl of BrowserView and how espresso uses this method in OnWebView, he was unable to find/click on button of webview.

Browser other questions tagged

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