Test hybrid apps with UFT One

This topic describes how to use UFT One and Digital Lab to test hybrid apps on mobile devices.

Add-ins and Record and Run settings

UFT One support for hybrid mobile apps is based on the Web Add-in. When testing hybrid apps, make sure to:

  • Load both the Web Add-in and the Mobile Add-in when starting UFT One.

  • For web testing on mobile devices, use settings on both the Web and Mobile tabs of the Record and Run Settings dialog. For details, see Define Mobile Record and Run Settings.

Back to top

Test objects and methods

All Web test object methods are supported when testing hybrid apps, including Swipe and LongPress.

Exceptions include any device (mouse)-related methods, as they are not relevant for mobile devices. These include:

  • Drag

  • Drop

  • MiddleClick

  • RightClick

Open the web page at the start of your script

All steps on hybrid apps must start with Device.App.MobileWebView.Page. For example:

Device("Device").App("MyMobileApp").MobileWebView("MobileWebView").Page("Page")...
Device("Device").App("MyBank").MobileButton("Register").Tapa
Device("Device").App("MyBank").MobileWebView("MobileWebView").Page("Register for Online Access").WebList("selectedAccountType").Select "Banking Account"
Device("Device").App("MyBank").MobileWebView("MobileWebView").Page("Set up access - MyBank").Image("btn_b_next").Click
Device("Device").App("Mobile Browser").MobileWebView("Web View").Page("Demo Page").WebButton("Click Here").LongPress
Device("Device").App("Mobile Browser").MobileWebView("Web View").Page("Demo Page").WebElement("Item Picker").Swipe moveRight, 522

Click vs. Tap methods

Use the Click method instead of Tap in steps on hybrid apps, just as you would for a web app.

Hybrid scripts

For tests that include both mobile and web steps, make sure you define settings on both the Web and Mobile tabs of the Record and Run Settings dialog.

The following steps show an example of a hybrid script.

Device("Device").App("Hybrid Form Page").MobileWebView("webView").Page("Profile").WebEdit("lastname").Set "test"

Browser("Google").Page("Google").WebEdit("search").Set "abc"

Back to top

Checkpoints and output values

Only the following checkpoints and output values are supported for hybrid apps:

  • Standard checkpoint and output value

  • Page checkpoint

  • Table checkpoint

  • Bitmap checkpoint

  • Text/Text Area checkpoints and output values

Back to top

Advanced configuration

In UFT One, most of the options available under Tools > Options > Web are not relevant when testing hybrid apps.

However, it is recommended to not change the settings in the Advanced pane, as this may affect the results of steps run on hybrid apps.

Back to top

Non-injected iOS hybrid support

iOS hybrid App store apps or apps signed with an Enterprise certificate do not allow WebView injection. To test such applications, use non-injected hybrid support as follows: 

  • In Digital Lab, or when connected to the device from UFT One, enable the Hybrid v2 option on your device.
  • Place your Mobile test objects inside a MobileNativeWebView parent test object, inside the application object. If you record, spy, or learn objects from your application, a MobileNativeWebView parent test object is automatically included.

Back to top

See also: