Ich betreiben einige Testcodes von Espresso WebEspresso webView webkeys Ausfälle auf dem Android 8.0-Simulator
@Test
public void typeTextInInput_clickButton_SubmitsForm() {
// Lazily launch the Activity with a custom start Intent per test.
mActivityRule.launchActivity(withWebFormIntent());
// Selects the WebView in your layout. If you have multiple WebView objects,
// you can also use a matcher to select a given WebView,
// onWebView(withId(R.id.web_view)).
onWebView()
// Find the input element by ID.
.withElement(findElement(Locator.ID, "text_input"))
// Clear previous input and enter new text into the input element.
.perform(clearElement())
.perform(DriverAtoms.webKeys(MACCHIATO))
// Find the "Submit" button and simulate a click using JavaScript.
.withElement(findElement(Locator.ID, "submitBtn"))
.perform(webClick())
// Find the response element by ID, and verify that it contains the
// entered text.
.withElement(findElement(Locator.ID, "response"))
.check(webMatches(getText(), containsString(MACCHIATO)));
}
Es ist auf dem 7.1.1 Simulator gearbeitet, aber nicht auf den 8,0 Ich habe die Fehlermeldung als
einstellenverursacht durch: java.lang.RuntimeException: Fehler in evaluationEvaluation: Status: 13 Wert: {message = gesetzt Kann die Auswahl end} hasMessage: true Nachricht: nicht das Ende der Selektion
wenn ich den Code
element.
.perform(clearElement())
.perform(DriverAtoms.webKeys(MACCHIATO)) => perform(webClick())
Dann funktioniert es ändern. Ich denke, es kann das Element finden, das die Aktion nicht ausführt. Muss ich irgendetwas in meinem Code ändern?
Danke, es funktioniert für mich. Ich bin seit einiger Zeit in der alten Version von Android Espresso. – Puff