How to perform actions on the webview of GMAIL app?

Hello all,

I am automating the Gmail android application. While adding a new account I’m unable to inspect elements. Please help me out.

Thanks in advance.

@amitjaincoer191, @auto-geek, @pr4bh4sh, @Brian_Watson anyone please provide me a solution.

Can you add the screen shot of element inspector.

Hi @pr4bh4sh , here is the screenshot:

For webview to automate one needs to change the driver context to “WEBVIEW” and once done with the webview, change the driver context back to native.

Hi @Umar_Khan,
Okay, I changed the context to “WEBVIEW” and now the next part is to locate the elements in the web view.
Actually, this is exactly what I want to know. How to inspect the elements of this web view, how to find the element properties like ID, XPATH etc.
I tried with “UI Automator viewer” just to assure that these are web elements then I tried to inspect these elements with the help of “Remote Debugging”.
As this is the web view, these elements can not be inspected using “UI Automator viewer” or “Appium Inspector”. As far as I know the other solution for these kinds of cases is to inspect it using “Remote Debugging”. But it didn’t work for me.

Make sure setWebContentsDebuggingEnabled is set to true as described in the remote debugging docs.