Android espresso click the WebView button
•
Android
Hello, I need to click the web view in the test. The button in the WebView code has the following code:
<input type="submit" onclick="ignoreClose()" name="UsernamePasswordEntry" value="Submit">
I try this:
onWebView().withElement(findElement(Locator.NAME, "UsernamePasswordEntry")).perform(webClick());
But I got:
java.lang.RuntimeException: java.lang.RuntimeException: Atom evaluation returned null!
Is there any way to deal with it?
resolvent:
Try using locator.xpath, for example
onWebView().withElement(findElement(Locator.XPATH, "here put XPATH")).perform(webClick())
To get the XPath, simply check the element on the web, right-click the marked element, and copy the XPath
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码