Native and hybrid app support
TruClient for Mobile supports both native and hybrid (combined Web and native) apps.
Native app support
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 Digital Lab for execution.
Hybrid app support
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 Steps box. See Steps box.
AUT interface library
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.
Digital Lab step arguments
TruClient integration with Digital Lab 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. To see a list of the actions and gestures, expand the Step section and open the Action drop down.
In the Step editor, the Step Timeout value applies as follows:
For both native and hybrid apps, the replay engine waits 20 seconds for the object to appear. If the object is not found within 20 seconds, the step fails.
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 waits 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 are available to you for use.
- Spy/Highlight operations do not generate Activate WebView steps. You can however, add them manually from the TruClient Steps box for Native Mobile.
- 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 cannot measure the time it took to turn the Bluetooth feature on the device.