Has Appium.app Inspector ever shown HTML for WEBVIEW?

It’s been a bit since I’ve attempted to code webview tests, so I don’t exactly recalling how I obtained the HTML tags for my current webview tests. But I thought I pulled them directly from the Appium.app Inspector.

  • Appium Server 1.4.16
  • Appium.app 1.4.13 (pointing to the server install, only used for Inspector)
  • Python Client
  • iOS simulator

My process is:

  • Launch appium server with -app switch for my simulator location
  • Startup Appium.app with the developer settings set to my appium server installation
  • Click Inspector button
  • Simulator successfully launches, Inspector can discover and report all of the native elements without issue
  • Navigate to a hybrid webview
  • Refresh Inspector
  • It successfully discovers and reports the NATIVE_APP and WEBVIEW_1 context
  • Select WEBVIEW_1 and click Change button
  • Inspector refreshes, it’s set to WEBVIEW_1 but still only shows native elements, no HTML
  • Copy XML and paste, it’s only showing the native elements, no HTML

I’ve tried with an 8.4 and 9.2 simulator with the same results.

Am I crazy that I thought the Inspector used to show the HTML after switching to WEBVIEW context?

Currently I’m opening the web asset in Chrome and inspecting there, which is a usable process thus far.

I recently tried switching contexts in Appium to handle Android WebViews. I could not get Appium to show HTML elements; they showed only as Android native elements.

Appium 1.4.16

@afwang your issue could be that your Android project does not have WebView debugging enabled within the app itself. That will prevent Android webviews from being discoverable.

Ah, I learn something new everyday. :slightly_smiling: Even though I’ve enabled web view debugging (I’m guessing this is done with WebView.setWebContentsDebuggingEnabled()), I do not see any change in the XML layout returned from Inspector. All UI elements still appear as Android native elements (on Android API 21).

Granted, I never had to handle a lot of WebView work before, so I’m not sure if this is a regression in Appium or the Android and iOS automation libraries.

EDIT: The WebView inspector in Chromium works, though!