Native and hybrid app support
TruClient for Mobile supports both native and hybrid (combined Web and native) apps.
TruClient detects objects in native mobile apps, generating a TestObject every time the user interacts with a native object, for all supported elements. TruClient sends the TestObject step to Mobile Center for execution.
Beginning with TruClient 12.55, TruClient - Native Mobile scripts use Object identification methods and WebView to recognize objects on your mobile device. A WebView is a native component that displays interactive web content. Hybrid apps host one or more WebViews together with other native components.
- In Android, the WebView is based on Chromium.
- In iOS, the WebView types are UIWebView (iOS 2.x and higher) and WKWebView (iOS 8.x and higher) .
For the Descriptor identification method, you can specify an object by its ordinal.
Each time TruClient records a WebView component, it generates an Activate WebView step. This step always precedes the action on the WebView object. However, to run an individual step or to highlight a Web object—you must first run the Activate WebView step. If the Activate WebView step is not in the script, you can add it from the Toolbox.
Beginning with version 12.55, TruClient includes the AUT interface which allows you to access the AUT's document and window properties. For example:
By default, Web steps run in the WebView context and can utilize the AUT API.
Runtime, non-TestObject steps that use the AUT keyword, run in the WebView context on the device. If they do not use the AUT keyword, they run in the TruClient browser.
Utils.import, Utils.clearCookies, Utils.clearCache, Utils.addAutoHeader, Utils.removeAutoHeader, Utils.cleanupAutoHeaders, Utils.addAutoFilter, Utils.removeAutoFilter, Utils.cleanupAutoFilters
IO.read, IO.write, IO.createDir, IO.delete, IO.isExist
TruClient and LoadRunner
TC.getUserIP, TC.setProxy, TC.addNetworkFilter, TC.clearNetworkFilter, TC.startLogRequests, TC.stopLogRequests
Evaluate C API is not supported for TruClient Native Mobile.
Mobile Center step arguments
TruClient integration with Mobile Center provides additional Web roles for Step objects.
Objects can have one or more roles, to which the relevant actions apply. For example, a button Web role, can have a Click, Tap, or Drag action. For details, see Step argument reference.
Step types can be Web, Native, or Runtime (standard TruClient). For TruClient Native Mobile scripts, Web steps include actions that let you synchronize your test execution. These include closing dialog boxes that pop up, such as alerts or other prompts.
In addition, beginning with version 12.55, TruClient supports a variety of touch actions and gestures, such as Rotate, Rotate and Pinch, and Touch and Drag. All gestures can be recorded or added manually.
In the Step editor, the Step Timeout value applies as follows:
For both native and hybrid apps, the replay engine will wait 20 seconds for the object to appear. If the object is not found within 20 seconds, the step will fail.
Native apps have a limitation, that the value you specify in the Step Timeout field is ignored.
For hybrid apps, the value you specify applies to the actual action. For example, if you specify 60 in the Step Timeout field, the replay engine will wait one minute for the end event of the action.
Most apps respond to standard DOM events, such as mouse-clicks rather than touch events. Many apps convert a touch into a mouse click. For this reason, TruClient's default behavior records clicks, and not taps. However, the tap actions are stored in the Alternative Steps list and will be available to you for use. For details about using Alternative steps, see the Step editor.
- Spy/Highlight operations do not generate Activate WebView steps. You can however, add them manually from the TruClient toolbox for native mobile.
- Windows Phone devices do not support the enhanced TruClient 12.55 hybrid integration. Some of the capabilities such as object identification and addition step arguments, will not be available.
- Web operations on apps that are not packaged, are not recorded.
- When recording multiple apps, you may need to add a Launch Application step (via the Toolbox). This is useful in the case when a user would need to scroll or swipe to another view to see the app. This is not required for the app launched at startup.
- It is best to record multi-touch gestures (such as Rotate and Pinch) on physical devices, and not from within the remote view.
- If a recorded swipe gesture replays successfully but doesn’t affect the AUT, extend its duration manually or use a trigger swipe. To do a trigger swipe, do a long press until a cross appears. Then move in the direction of the intended swipe and release.
- Transaction response time cannot be generated for non-packaged apps. For example, the native Android Settings app, you will not be able to measure the time it took to turn the Bluetooth feature on the device.
For additional issues and limitations, see the product Readme file.