Testing Hybrid Applications on iOS

Hybrid applications (apps) are apps that are run on the device, like native applications, but are written with web technologies, for example HTML5, CSS, and JavaScript.

Silk4J provides full browser support for testing debug hybrid apps that consist of a single web view, which is embedded in a native container. A common example of such a hybrid app would be an Apache Cordova application.

To test non-debug hybrid apps without remote debugging enabled or hybrid apps that include more than one web view, enable the Silk4J fallback support by setting the option OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT to TRUE. For additional information, see Setting Advanced Options. With the fallback support enabled, Silk4J recognizes and handles the controls in a web view as native mobile controls instead of browser controls. For example, the following code clicks on a link when using browser support:
desktop.setOption(CommonOptions.OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT, false);
desktop.<DomLink> find("//INPUT[@id='email']").click();
With the fallback support enabled, the following code clicks on the same link:
desktop.setOption(CommonOptions.OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT, true);
desktop.<DomLink> find("//MobileTextField[@resource-id='email']").click();

The process for testing a hybrid app on iOS is the same as the process for testing a mobile native application. For additional information, see Testing Native Mobile Applications on a Physical iOS Device or Testing Native Mobile Applications on an iOS Simulator.

Before testing a hybrid app on an iOS device, ensure that the Web Inspector is activated on the device. For additional information, see Preparing an iOS Device for Testing.