Automate Terminals

Kapow supports connection to and interaction with 3270, 5250 and stream-based (vt2xx) terminals.

Command timeout for automating terminals is set either on the Device Automation tab of the Design Studio Settings window for executing the workflow in Design Studio, or in the Device Automation section on the Security tab of the RoboServer Settings window for roboserver execution. See Runtime > Security in the Kofax Kapow Administrator's Guide.

Note You do not need to install the Device Automation service on your remote computer or create a device mapping in the Management Console when automating a terminal device.

The terminals do not support mouse operations even though the Move Mouse and Click steps can be inserted. The terminals must be operated using keyboard keys.

Fonts

Kapow bundles several fonts for the terminals to render their screens. They are located at:

C:\Program Files\Kapow 10.3.0\nativelib\hub\windows-x32\XXX\fonts

Where XXX is a three-digit number for internal purposes.

If a terminal connection is established with a host that uses characters that are not found in the bundled fonts, the characters render as squares on the screen. This can be fixed by adding the path to a Truetype font in the fontlist.txt file found in the same Kapow font directory. For example:

C:\TerminalFonts\MyTerminalFont.ttf

tn5250 Terminals
To connect to 5250 terminals, use the following connection string:

tn5250://<hostname>:<portnumber>?env.TERM=<terminal type>.

Where hostname is the terminal name or IP address, portnumber is the terminal connection port number, and env.TERM is the value of the client terminal type after the mode is switched by the URL. The default terminal type is "IBM-3179-2". Note that env.TERM parameter is valid for the tn5250 terminal only. Kapow supports the following terminal types:

  • "IBM-3477-FC"

  • "IBM-3477-FG"

  • "IBM-3180-2"

  • "IBM-3179-2" (Default)

  • "IBM-3196-A1"

  • "IBM-5292-2"

  • "IBM-5291-1"

  • "IBM-5251-11"

  • "IBM-5555-B01" (DBCS enabled)

  • "IBM-5555-C01" (DBCS enabled)

Kapow supports terminals in both 80x24 and 132x27 mode.

The 5250 terminal used a special keyboard with many keys that are not available on present day PC keyboards. To enter such keys, the following calculated keys may be used in the Press Key Step.

  • VK_RETURN

  • VK_ENTER

  • VK_TAB

  • VK_BACKTAB

  • VK_UP

  • VK_DOWN

  • VK_LEFT

  • VK_RIGHT

  • VK_CLEAR

  • VK_BACKTAB

  • VK_F1

  • VK_F2

  • VK_F3

  • VK_F4

  • VK_F5

  • VK_F6

  • VK_F7

  • VK_F8

  • VK_F9

  • VK_F10

  • VK_F11

  • VK_F12

  • VK_F13

  • VK_F14

  • VK_F15

  • VK_F16

  • VK_F17

  • VK_F18

  • VK_F19

  • VK_F20

  • VK_F21

  • VK_F22

  • VK_F23

  • VK_F24

  • VK_ROLLDN

  • VK_ROLLUP

  • VK_BACK

  • VK_HOME

  • VK_END

  • VK_INSERT

  • VK_DELETE

  • VK_RESET

  • VK_PRINT

  • VK_HELP

  • VK_SYSREQ

  • VK_CLEAR

  • VK_REFRESH

  • VK_FIELDEXIT

  • VK_TESTREQ

  • VK_TOGGLE

  • VK_ERASE

  • VK_ATTENTION

  • VK_DUPLICATE

  • VK_FIELDMINUS

  • VK_FIELDPLUS

  • VK_PREVWORD

  • VK_NEXTWORD

  • VK_PREVFLD

  • VK_NEXTFLD

  • VK_FIELDHOME

  • VK_EXEC

  • VK_MEMO

  • VK_COPY_TEXT

  • VK_PASTE_TEXT

  • VK_NEWLINE

  • VK_ERASE_EOF

  • VK_KANJI

See the 5250 terminal documentation for more information.

To facilitate automation, Kapow has added the following keys:

  • VK_VIRTUAL_FIELDEXIT

    This key functions as VK_FIELDEXIT, but only if the cursor is not at the first position of a field. This can be used to exit a field if it is not completely filled, but suppress the FieldExit if the cursor has just wrapped to the next field.

  • VK_DBCS_SPACE

    Types a DBCS space.

See Basic Terminal Tutorial for information on how to connect to and extract information from a 5250 terminal.

Character Encoding

To specify character encoding of the host, add a charset query parameter to the URI. For example:

tn5250://hostname:port?LineCodePage=cp838

Kapow supports the following character sets for tn5250 terminals:

Character name Host codepage

US/Canada

cp037 (default)

Multinational

cp500

Thai

cp838

Japanese

cp930

Simplified Chinese

cp935

Korean

cp933

Enhanced 5250 interface support
To enable the enhanced interface for non-programmable workstations on the host, add the enhanced=on query parameter to the URI. For example:

tn5250://hostname:port?LineCodePage=500&enhanced=on

This setting enables support for continued-entry fields.

3270 Terminals
Kapow supports 3279-4 color 80x43 terminal, which is the default of the underlying terminal emulator.

The 3270 terminal used a special keyboard with some keys that are not available on present day PC keyboards. To enter such keys, the following calculated keys may be used in the Press Key Step.

  • VK_RETURN

  • VK_TAB

  • VK_BACKTAB

  • VK_Up

  • VK_Down

  • VK_Left

  • VK_Right

  • VK_F1

  • VK_F2

  • VK_F3

  • VK_F4

  • VK_F5

  • VK_F6

  • VK_F7

  • VK_F8

  • VK_F9

  • VK_F10

  • VK_F11

  • VK_F12

  • VK_F13

  • VK_F14

  • VK_F15

  • VK_F16

  • VK_F17

  • VK_F18

  • VK_F19

  • VK_F20

  • VK_F21

  • VK_F22

  • VK_F23

  • VK_F24

  • VK_ATTENTION

  • VK_BACKSPACE

  • VK_CLEAR

  • VK_DELETE

  • VK_DUPLICATE

  • VK_HOME

  • VK_INSERT

  • VK_PA1

  • VK_PA2

  • VK_PA3

Character Encoding

To specify character encoding of the host, add a charset query parameter to the URI. For example:

tn3270://hostname:port?charset=cp930

Kapow supports the following character sets for tn3270 terminals:

Character name

Host codepage

belgian

500

belgian-euro

1148

bracket

037

brazilian

275

chinese-gb18030

1388

cp1047

1047

cp870

870

finnish

278

finnish-euro

1143

french

297

french-euro

1147

german

273

german-euro

1141

greek

423

hebrew

424

icelandic

871

icelandic-euro

1149

italian

280

italian-euro

1144

japanese-kana

930

japanese-latin

939

norwegian

277

norwegian-euro

1142

russian

880

simplified-chinese

935

slovenian

870

spanish

284

spanish-euro

1145

swedish

278

swedish-euro

1143

thai

1160

traditional-chinese

937

turkish

1026

uk

285

uk-euro

1146

us-euro

1140

us-intl

037

SSH / Telnet Settings (vt2xx)

The underlying Kapow SSH client is based on PuTTY and can potentially be configured to access any system that PuTTY can access. You can configure all the same parameters as you can with a PuTTY session, but instead of requiring the actual PuTTY client to define sessions, you can define session settings by adding parameters to the connection URL.

The headless terminal does not automatically detect the code page on the server. This is why sending and receiving non-ASCII characters requires you to specify the code-page to use for character encoding and decoding. If you do not specify a code page, the robot assumes the server's locale is set to UTF-8. You can specify the code page by using the LineCodePage parameter. The Kapow terminal is built using "libicu" for character encoding. Use the libicu converter explorer at http://demo.icu-project.org/icu-bin/convexp?s=ALL to inspect code pages and their aliases. The list of supported character sets equals that of ICU (International Components for Unicode) library. See ICU documentation for details.

The following is a list of the most commonly used parameters for the stream-based terminals.

TermWidth

Sets the terminal width (default is 80).

TermHeight

Sets the terminal height (default is 24).

PublicKeyFile

Specifies the path to a PuTTY formatted *private* key.

TerminalType

Sets the terminal type (default is "xterm").

LineCodePage

Specifies the code-page to use for character encoding and decoding (default is UTF-8).

To set the parameters on your session, append them to the URI when you enter the value into the Open step.

ssh://<username>@<hostname>?TermWith=160&TermHeight=48&LineCodePage=UTF-16

SSH Authentication and Security Guide
When automating applications using SSH, the user can be authenticated in four different ways.
  1. The underlying ssh client will prompt for a password. Enter the password using "Enter Text" step followed by a "Press Key" step (return).
  2. An unencrypted private key can be placed on the file system of Design Studio and your RoboServers. Add the PublicKeyFile=<path to key> line to the connection URL. The connection URL could look like the following.

    ssh://<username>@<hostname>?PublicKeyFile=<path to key file>

    It is important that the key file is PuTTY formatted. On Linux you can use puttygen to transform an open-ssh private key.

  3. An encrypted private key can be placed on the file system of Design Studio and your RoboServers. Add PublicKeyFile=<path to key> to the connection URL. The underlying ssh client should prompt for a password upon connection. To enter the password, use "Enter Text" step followed by a "Press Key" step (return).
  4. Use Pageant on Windows and ssh-agent on Linux with an encrypted key on the local file system.
    • On Windows, run Pageant as the same user running the RoboServer and add the key.
    • On Linux, run ssh-agent and ssh-add and copy the SSH_AUTH_SOCK and SSH_AGENT_PID environment variables to the RoboServer and Design Studio environment. You can do it by appending the lines to RoboServer.conf and DesignStudio.conf as follows.

      • set.SSH_AUTH_SOCK=<value as outputted from ssh-agent>
      • set.SSH_AGENT_PID=<value as outputted from ssh-agent>

      Or by having them already in your environment when starting the RoboServer and Design Studio.

The authentication methods above are listed from the least secure to the most secure as follows.

  1. Anyone able to read the robot can extract the password and log onto the system.
  2. The attacker would have to have the private key from your file system, so obtaining the robot from a Management Console is not enough.
  3. The attacker would need both the robot and the private key file.
  4. The attacker would need to obtain the password for the private key to gain access.
Use TLS/SSL
Kapow supports TLS/SSL communication in terminals. To use TLS/SSL, open either stn3270 or stn5250 terminal in the open step of the Device Automation workflow. For example, stn3270://hostname:2023. Note that Kapow does not verify the certificate presented by the server.