Basic terminal tutorial

In this tutorial, we will connect to an iSeries (tn5250) terminal, log in, and extract information from the terminal.

See Automate terminal emulators for information on terminal prerequisites and settings.

  1. Open an existing or create a new Robot Robot icon.

  2. Click Prepare Execution.

  3. In the Robot definition pane, add variables that contain a login name and a password to log in to a terminal. Also, add a variable to store the output text.
  4. In the Robot workflow, add the Terminal step with necessary parameters. In this tutorial we connect to the iSeries (tn5250) terminal. Configure the step.

    • Emulator: iSeries (tn5250)

    • Action: Connect

    • Host: terminal5250_server:11623

    • Options: env.TERM=IBM-3477-FC

    Where terminal5250_server is the terminal name or IP address, and :11623 is the terminal connection port number. If we omit the env.TERM parameter, the emulator connects to a default terminal type (IBM-3179-2). See Supported tn5250 Driver Terminals in Automate terminal emulators. This option is specific to the iSeries (tn5250) driver.

    If you restart the robot, it will discard the session and close the terminal.
  5. In the Recorder View, right-click the terminal tab and select the Enter Field application action to enter the user name and move the cursor to the Password field.

    Right-click the terminal tab and select Enter Field to enter the password and move the cursor to the next field.

    In a production environment, use variables to pass in login and password.

  6. Right-click the terminal tab and select the Press Key step. By default it selects Enter as a key.

    Execute this step to log in to the iSeries host.

  7. Starting from this point, your robot can interact with the applications on the iSeries host.

    Right-click the top line of the screen and select Guard > Location Found to wait for the iSeries to process input and update.

  8. Use the Enter Field action to enter fields sequentially using FieldExit keys.

    Alternatively, select the field in the Recorder view and in the Robot workflow, add the Enter Text step to enter data in that specific field. To exit the field, add the Press Key step with the calculated VK_FIELDEXIT key.

  9. After all the required steps are completed to retrieve the data, you can extract the information from the terminal window. To extract a text line, right-click a row, select Extract Value From > Text Into> <variable name>. Click Step Into. The Variables branch in the State pane shows the value you extracted.

    To take a screenshot of the entire terminal window, select the screen element in the Recorder View and click Extract Image Into. Select an existing variable or create a new one by selecting Create Variable.