AmeyaB avatar image
AmeyaB asked

HOW TO: Start an iTest session interactively when the session profile uses parameters

The Spirent Best Practices recommend that you use Reference Session Profiles to store common properties associated with devices. They also recommend the use of parameters rather than hard-coded values. These parameter values are resolved within an “execution context”, which is created only when you execute a test case.

What if you want to start an interactive session directly from the Reference Session Profile that uses parameters? If you try to do this, iTest throws up the following error:

Error: Unable to substitute "[param host]" : Parameter 'host' does not exist

This is because iTest is unable to resolve the parameter value because there is no execution context as we are not executing a test case.

To get around this issue, add a default value to the param syntax:

[param param_name default_value] e.g. [param host]

This tells iTest to use the default value of "" whenever it is unable to resolve the parameter. So when you start the session interactively, iTest will use "" as the value, and when you run the test case, it will use whatever is the resolved value of the “host” parameter.

Default values are also available on commands other than param. To determine whether a command can only be resolved with an execution context (i.e. only when you run a test case), type the “[“ character into the value of the field in the session profile — iTest displays the list of commands and their syntax. Any command that uses an optional ?default? argument requires an execution context.

iTestsession profileparametersdefault valuesbest practices
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers


Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.