Terminal emulator package guide
Version 2.14.1. Installed versions can differ. Examples are illustrative and not tested.
Prerequisites
Use an SSH or Telnet text terminal service that the Device can reach. No desktop terminal or browser is used. IBM 3270 and 5250 are not supported. SSH signs in with a password; private keys are not supported. Telnet is not encrypted and does not sign in with the Credential: answer the host's login prompts with Send text.
Connect with Session name=Default, Terminal type=SSH, Host=terminal.example.com, Port (0 for the protocol default)=0, Timeout (seconds)=30, and a Credential variable for a test account. Enter the server's SHA-256 fingerprint from your administrator. If blank, the first key seen for that host and port is trusted and kept (SFTP uses the same list), and a later change is refused before the password is sent. If the stored key list is damaged, Connect fails. Use another session name for a second connection, and Disconnect when you finish.
Later actions need an open session in the same Run. Text is sent and received as UTF-8. All received text collects in one buffer. Get screen text returns it as raw text, not a screen layout, and can include prompts, echoed input and control codes.
The examples use a test service that writes Ready> , then answers the line sample with Received sample. Other hosts give their own output. Before you read a reply, use Wait for text. It searches the whole buffer, case-sensitive, so an old prompt or echo can match. Use Get screen text with Clear=true to empty the buffer first. New text can arrive at any time. The Connect timeout applies only to SSH; Wait for text has its own timeout for both protocols.
Shared fields
Every action uses this field.
| ID | Field | Type; default; requirement | Value |
|---|---|---|---|
session | Session name | Stringdefault DefaultOptional. | Connect gives the session this local name, for example Default; later actions use it. It is not an account, a server or a Credential. An action with a session name that is not open fails. |
Actions
There are no conditions.
Connect (terminalEmulatorConnect)
Open an SSH or Telnet session for later text actions.
Inputs
Also uses the shared fields.
| ID | Field | Type; default; requirement | Value |
|---|---|---|---|
terminal | Terminal type | Terminaldefault SSHOptional. | SSH: shell with password sign-in. TELNET: not encrypted, no sign-in with the Credential. Choices: SSH, TELNET. |
host | Host | Stringdefault emptyRequired. | Host name without a scheme, such as terminal.example.com. Outer spaces are removed; empty fails. |
port | Port (0 for the protocol default) | Numberdefault 0Optional. | 0 uses SSH 22 or Telnet 23; other ports: 1 through 65535. A negative value also uses the default; prefer 0. |
credential | Credentials | Credentialdefault emptyOptional. | SSH: Credential with a username (not empty) and the account password. Telnet ignores it. |
timeout | Timeout (seconds) | Numberdefault 30Optional. | SSH connection timeout in whole seconds, at least 1. Telnet checks the value but does not use it. |
expected | Expected SSH host key fingerprint (SHA-256) | Stringdefault emptyOptional. Shown when terminal. | SSH: SHA-256 fingerprint from your administrator, with or without SHA256: and trailing =. Blank trusts the first key (see Prerequisites). Telnet ignores it. |
Outputs
| ID | Type | Result |
|---|---|---|
session | String | The Session name, normally Default. You can bind it to a String or use the name itself in later actions. |
Example
Use the SSH settings in Prerequisites. Bind Create terminal session to String terminalSession. For Telnet, set Terminal type=TELNET and its port, and answer any login prompt with Send text.
Expected result
terminalSession is Default. The Ready> prompt can arrive later: use Wait for text. A bad host or port, a failed SSH sign-in or a refused host key fails, and no session is stored.
Disconnect (terminalEmulatorDisconnect)
Close and remove the session.
Inputs
Uses the shared fields.
Outputs
None.
Example
At the end, set Session name=Default.
Expected result
The connection closes. Later actions with Default fail until Connect runs again.
Get screen text (terminalEmulatorGetText)
Read the received-text buffer and, if you want, clear it for the next exchange.
Inputs
Also uses the shared fields.
| ID | Field | Type; default; requirement | Value |
|---|---|---|---|
clear | Clear the buffer afterwards | Booleandefault falseOptional. | False keeps the buffer. True returns its text, then clears it; text that arrives later stays for later actions. |
Outputs
| ID | Type | Result |
|---|---|---|
result | String | All buffered text, possibly empty, including earlier replies. |
Example
After Wait for text finds Received sample, set Session name=Default, Clear the buffer afterwards=true; bind result to String terminalText.
Expected result
terminalText includes Received sample and any earlier prompts or echoes. A read right after is empty if nothing new arrived. Clear does not change terminalText or remove control codes from it.
Send text (terminalEmulatorSendText)
Send text to an open terminal, with Enter if you want. It does not wait for a reply.
Inputs
Also uses the shared fields.
| ID | Field | Type; default; requirement | Value |
|---|---|---|---|
text | Text | Stringdefault emptyRequired. | Exact text to send, such as sample. |
press | Press Enter afterwards | Booleandefault trueOptional. | True adds carriage return and line feed (\r\n). False sends only Text, for partial input. |
Outputs
None.
Example
After Wait for text finds Ready> , set Session name=Default, Text=sample, Press Enter afterwards=true. Then use Wait for text with Text=Received sample.
Expected result
The host gets sample and a line break, and the test service answers Received sample later. A closed connection can fail. No command exit code is returned.
Wait for text (terminalEmulatorWaitForText)
Wait until the exact text is anywhere in the buffer, or fail when the time runs out. The buffer is kept.
Inputs
Also uses the shared fields.
| ID | Field | Type; default; requirement | Value |
|---|---|---|---|
text | Text | Stringdefault emptyRequired. | Exact text, not empty, case-sensitive, such as Received sample. Matches anywhere in the buffer; no regular expressions. |
timeout | Timeout (seconds) | Numberdefault 30Optional. | Longest wait in whole seconds, at least 1, such as 10. Applies to SSH and Telnet. |
Outputs
None.
Example
After you send sample, set Session name=Default, Text=Received sample, Timeout (seconds)=10. If an earlier reply could match, clear the buffer before the exchange.
Expected result
The step continues when Received sample is found. received sample does not match. Text already in the buffer matches at once. If the text is not there after 10 seconds, the step fails (there is no true or false output).