Compiling Your App (Hybrid Apps)
Hybrid Apps need to be handled differently than Native Apps because Hybrid Apps contain WebViews. A WebView hides information about its nested elements. Therefore it gets challenging to fetch the required element attributes and automate WebViews. One way to work with this scenario is to set the WebViews for debugging in debug mode and use the debug version of the app for test-automation.
Appium comes with built-in hybrid support via Chromedriver, which allows the automation of any Chrome-backed Android web views. During the app build stage itself, it is necessary to set to
setWebContentsDebuggingEnabled property on the android.webkit.WebView element. Once debugging is enabled, Appium can interact with the WebView elements in the app.
Read more about configuring WebViews for debugging in the Android remote debugging docs.
- To build a debug APK, open a command line and navigate to the root of your project directory.
- Initiate a debug build with
gradlew assembleDebug. This creates an APK named
- The file is already signed with the debug key and aligned with zipalign, so you can immediately upload it.
Appium Docs - Automating Hybrid Apps