A lot of apps have at least one screen that isn't native: a login, a payment form, a help page, rendered in a WebView. The first time I pointed Appium at one, the inspector showed a box with a few unnamed fields, my usual locators found nothing, and every guide I opened started talking about "contexts".
It turns out there are two ways in. I'll call them Mode 1 and Mode 2:
Mode 1, through the native tree. You stay in the NATIVE_APP context and find the web form in the accessibility tree the OS builds for it. This works on any build, because the OS makes web content accessible anyway.
Mode 2, through the DOM. The app lets a debugger attach to its WebView. A WEBVIEW_β¦ context appears, you switch into it, and from there it's basically Selenium: CSS selectors, execute_script , the real DOM. This only works if the app allows it.
Below I go through both, on iOS and on Android, against the same HTML form.β¦