Test hybrid apps with UFT

This topic describes how to use UFT and Mobile Center to test hybrid apps on mobile devices.

Add-ins and Record and Run settings

UFT 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
  • 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("MC Browser").MobileWebView("Web View").Page("Demo Page").WebButton("Click Here").LongPress
Device("Device").App("MC 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("Micro Focus Mobile Center").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, 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

See also: