I’ve recently added WebView feature in the appium-flutter-driver Webview still work in progress? #45. The v0.0.32 should have it.
debuggingEnabled is necessary t enable WebView availability in Flutter. Then, appium UIA2/XCUITest, which runs to handle the application under test as part of appium-flutter-driver, can find its WebView context.
So, you can do like the below code with the version:
``> driver = core.start_driver
> driver.available_contexts
=> ["NATIVE_APP", "WEBVIEW_com.pichillilorenzo.flutter_browser", "FLUTTER"]
> driver.set_context 'WEBVIEW_com.pichillilorenzo.flutter_browser'
=> nil
> driver.title
=> "Google"
> driver.available_contexts
=> ["NATIVE_APP", "WEBVIEW_com.pichillilorenzo.flutter_browser", "FLUTTER"]
> driver.set_context 'NATIVE_APP'
=> nil
You can get back to FLUTTER or NATIVE_APP context to handle Flutter or other native android areas.
The WebView works as UIA2/XCUITest driver feature, so capabilities such as enableWebviewDetailsCollection: true and ensureWebviewsHavePages: true, and arguments such as --allow-insecure=chromedriver_autodownload also work. They should help some cases.