Connecting to a Device and Capturing Commands

To connect to a configured device:

  1. Activate the Session Consoles pane by clicking the button or pressing the Alt+Shift+Ckeyboard shortcut.
  2. Configure the device session settings as described in Configuring Session Parameters.
  3. Alternatively you can you can load a previously configured session by clicking the Load from Storage... button. This opens a standard selection window ( Figure:Load Session window), which enables you to choose an existing session from those stored in the Resources/Device Sessions folder.

  4. Click the Connect button. A connection to the configured device is established, enabling you to input commands in the Session Consoles window that appears (Figure:Command Line Interface in Session Console). A StartSession command is automatically captured as a script step and is added to the end of the Script Steps table.

    Figure:Command Line Interface in Session Console

  5. The Connect button is not available when the device session uses variables as parameters. In such a case, when attempting to connect to a device, you are prompted to select the steps that initialize the variables and first replay these steps.

  6. As you type in CLI commands, if the capturing functionality is enabled (), these are automatically captured and new steps are added to the Script Steps table of the current script tab.
  7. If at any moment you wish to issue a command that is not supposed to be captured, switch capturing off () and continue interacting with the device. Eventually switch capturing on again when you wish to add more script steps while interacting with the test device.


        Depending on the active session type, the console supports the history and autocompletion functionality that is made available when pressing special keys on the keyboard, such as Backspace, Home/End, or arrow keys. For information on configuring the actual character sequences that are transmitted to devices for the special keys, refer to Defining Terminal Settings.

        For all session types, pressing the Enter keys on a connected session adds an empty test step. When the step is executed, an Enter character is sent to the configured device.

        In the case of the CmdTool and Tclsh sessions, you can change the cursor position using both the keyboard input and mouse interaction. For Telnet and SSH sessions, you can can move inside the command text only using the keyboard, while the mouse can only be used for local operations such as copy and paste.

    When the step is added, a response template called Local Step Response is associated with the step. It can be edited such as to define specific portions of the command response as targets, as described in Creating Response Templates.

    Upon connecting to a device, a device logon sequence might unfold requiring the input of user name and a password in response to device prompts. If such a case the device-generated prompts are captured into the DevicePrompts tab of the Session Consoles window, and any user input is recorded as script steps.

  8. As an alternative to typing in the commands manually, steps can also be added by pasting multi-line commands from the an external file to the Console window, whereby each pasted line is captured as a separate script step.
  9. While connected to the configured device, you can re-run selected steps from the Script Steps table by selecting (a) step(s) and clicking the button, then clicking Play selected only.
  10. At any moment, if you want to clear the contents of the Session Consoles pane, click the Clear Screen button.
  11. Eventually click the Disconnect button to terminate the session. Upon closing the session, a StopSession command is automatically captured as a last script step if the capturing functionality is switched on.

    While connected to a configured test device, it is recommended to avoid executing exit commands to the device. The preferred solution is to disconnect using a StopSession step, which can be automatically generated by clicking the Disconnect button.
    However, if you still need to use an exit command, be aware that when running the step, it will be marked as having had an error because the session was disconnected by the device and not by the TestComposer plug-in.

See Also

Configuring Session Parameters

Using Multiple Device Sessions