TCA.getAttr

Returns the value of the command line parameter passed to the test, or its default value.

TCA.getAttr(name);

Arguments

name. (string) Name of the command line parameter.

Return value

A promise that will be fulfilled with a string, which is the value of the command line parameter passed to the test or its default value.

General information

The command line parameter name is generally assigned by the user in the Additional Attributes tab in VuGen > Runtime Settings, or in Controller in the group command line argument.

When the test is run, the additional attribute or the group command line argument is passed to the test, as a parameter in the command line. During a test run, the value can be accessed with this function.

Example

To get the Controller command line argument, -MyServerURL http://myserver.com, call:

Copy code
TCA.getAttr(“MyServerURL”).then(function(result){
  TCA.done(result);
}).catch(function (error) {
  TCA.doneWithError(error);
});