TC.getAttr

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

TC.getAttr(name);

Arguments

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

Return value

A promise fulfilled with a string upon success.

Returns value of the attribute. Returns an empty string if the attribute does not exist.

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
(async ()=>{
    let attr = await TC.getAttr(“MyServerURL”);
})();