Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Espresso click on webView button

Tags:

Hello I need to click on web view in my test. Button in webView code has following code:

<input type="submit" onclick="ignoreClose()" name="UsernamePasswordEntry" value="Submit">

I try to handle it like that:

   onWebView().withElement(findElement(Locator.NAME, "UsernamePasswordEntry")).perform(webClick());

But I get:

java.lang.RuntimeException: java.lang.RuntimeException: Atom evaluation returned null!

Is there any way to handle it?

like image 459
F1sher Avatar asked Apr 15 '16 13:04

F1sher


1 Answers

Try to use Locator.XPATH, ex.

onWebView().withElement(findElement(Locator.XPATH, "here put XPATH")).perform(webClick())

To get XPATH, just go to inspect elements on Web and right click on marked element and just copy XPATH

like image 129
C. Alen Avatar answered Sep 28 '22 03:09

C. Alen