Chrome Remote Debugging - how to inspect elements in hybrid app (webview)

1k views Asked by At

I am trying to automate Gmail app for Android. In the "Compose" page, the part of the body of the message is a webview context. Using uiautomatorviewer i managed to retrieve the locator of the "body" element, but sending text to it - fails. Trying to switch context to "WEBVIEW" (i am using Appium) also fails. I wish to inspect elements in this page using chrome remote debugging. On my computer, i navigated to chrome://inspect/#devices and i launched the application on the android emulator. It looks alright. enter image description here But when i try to inspect elements, i see none. enter image description here What am i missing? (i made sure the to enable debugging and become a developer...)

1

There are 1 answers

4
dmle On

To enable WebView debugging setWebContentsDebuggingEnabled should be set on the WebView class. You need to make this change in your app code and rebuild it.

Following these instructions was good enough for me