Configuring Session Parameters
Depending on the interface to the configured device—Telnet, CmdTool, SSH1/SSH2/SSHAuto, Raw, TclSh, COM, TL1, Reporter and IxEmail—different connection parameters can be configured. Configurable parameters fall into the following categories:
- Connection: This category defines physical connection parameters, such as for example IP address and listening port of the configured device for protocol interfaces. See Defining Connection Settings.
- Terminal: This category defines physical connection parameters. See Defining Terminal Settings.
- DevicePrompts: This category specifies expected prompts to be received from the configured device. See Defining Device Prompts.
- Exceptions: This category defines connection exceptions. See See Also.
- Response Templates: This category defines a folder storing response templates that can be used with the session. See Specifying a Response Templates Folder.
Variables as Session ID
The StartSession command can accept a variable as the session name. This allows you to use this session name as variable inside procedures or loops.
The variable can be an integer or a string and the session name can be a combination of variables and constant string.
When you use variables as arguments in the StartSession command they need to be assigned, initialized, and have a default value. They may not be assigned, defined or have a default value unless the step is run. If the variable is not initialized, and a default value is not defined for it based on the structure of the session name the following scenarios occur when you try to execute the step in edit mode.
Session name contains only the input parameter name-the following message is displayed "The session name cannot be empty. Please set a valid name for the session."
Session name contains other text and the input parameter name, the session starts successfully.
After variables are defined in the test—using Assign Step, input parameters or variable returned by other commands—if you type `$' in the session column a list of available variables is available in a list from which you can select the appropriate one. As you continue typing the list gets filtered and only the variables matching to the characters that you typed appear in the list. If variables are not defined in a test, they are not available for selection as session names.
After you created a Session Id with a variable, it can be used in shared as well as local procedures. When the same Session Id is used in in two procedures having different set of settings of a session type, the device settings in the shared procedure are updated with new settings when the procedures are executed in edit mode and a message appears.
When the variable is updated all reference to it needs to be updated. A message appears asking your permission to update the session name for all steps which uses the variable. If you grant permission, all reference to the variable are updated.
The sessions can be transferred to other procedures by simply specifying the name of the session.
If a parameterized session is started and the StatSession step is executed in edit mode the session tab opens in the console pane. Usually the tab name is the name of the session, however when variables are used as session IDs, the tab name is the actual value of the variable and not the variable name.
Example:
The following example illustrates how variables can be used in session Id:
StartSession `Telnet-1'
StartSession `Telnet-2
For i from 1 to 2
Assign x `Telnet-$i'
Execute $x `show version'
Endfor
IxLoad TestComposer │ User Guide |