Asynchronous functions
The below asynchronous functions can be used in step argument fields in TruClient that can evaluate JavaScript. They cannot be used in objects and descriptor fields.
For details on how to use asynchronous APIs, see Use asynchronous APIs in JavaScript code.
Note:
-
Support for using synchronous APIs in JavaScript code will be deprecated in a future version. OpenText recommends using asynchronous APIs instead. For details, see Replace synchronous APIs with asynchronous APIs.
-
TruClient - Native Mobile scripts do not support asynchronous APIs. OpenText recommends using Generic API Action steps instead. For details, see Replace synchronous APIs with Generic API Action steps.
-
TruClient 2.0 - Web scripts support asynchronous functions only. For details on supported functions, see Using asynchronous functions with TruClient 2.0 - Web scripts.
In this topic:
- Using asynchronous functions with TruClient 2.0 - Web scripts
- General notes on using TruClient functions
- General functions
- Vuser functions
- Browser functions
- VTS functions
- Environment functions
Using asynchronous functions with TruClient 2.0 - Web scripts
When working with TruClient 2.0 - Web scripts, only asynchronous functions are supported.
The asynchronous functions have different names in TruClient 2.0: The "A" attached to asynchronous function names in legacy TruClient scripts is not used with TruClient 2.0.
For example, below are some comparative names of asynchronous functions in the two versions:
Name in legacy TruClient | Name in TruClient 2.0 |
---|---|
TCA.getParam(name) | TC.getParam(name) |
UtilsA.cleanupAutoFilters() | Utils.cleanupAutoFilters() |
TCA.vtcAddCell(colName, value, vtsName) | TC.vtcAddCell(colName, value, vtsName) |
IOA.createDir(path) | IO.createDir(path) |
UtilsA.getEnv(name) | Utils.getEnv(name) |
General notes on using TruClient functions
-
Use escape backslashes in path arguments. For example,
c:\\temp\\myFile.ps1
.
-
The following arguments can be used with any method:
-
object. The step's object as defined in the application.
-
AUT.window. Points to the global window object within the active window or tab of the application.
-
AUT.document. The global document object within the active window or tab of the application.
The AUT API provfides a common mechanism for handing the AUT window and AUT document for all TruClient protocols. For details, see Use JavaScript in the AUT window.
-