Hi. I want to set text for EditText field with “mobile: backdoor”:
((JavascriptExecutor)driver).executeScript("mobile:backdoor",ImmutableMap.of(
"target", "element",
"elementId", searchField.getId(),
"methods", ImmutableList.of(
ImmutableMap.of("name", "setText"),
ImmutableMap.of("args",
ImmutableList.of(
ImmutableMap.of(
"value", text,
"type", "java.lang.CharSequence")
)))));
Execution of above throws an exception: “An unknown server-side error occurred while processing the command. Original error: No public method setText definded on class android.widget.EditText or its parents which takes argument []”. What I’m doing wrong? Thanks.
P.S. I can’t use sendKeys() method, because element is a search field and when the driver types it updates UI after every charachter and Espresso fails…