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