Using host simulation

The HATS Toolkit includes a host simulation capability. With this capability, you can record host simulation trace files that can be saved and then used instead of a live host connection. Following are ways you can use host simulation files instead of using a live host connection:

In addition, the host simulation capability can be used in troubleshooting by allowing you to record a host simulation file in the runtime environment that you can use, along with other traces and logs, to document a failing scenario.

Notes:
  1. Host simulation is not supported for SSL enabled connections.
  2. Host simulation traces of ENPTUI-enabled devices recorded with the stand alone Host Simulator tool might not play back correctly if ENPTUI is not enabled in the HATS project.

Host simulation wizard

To start the host simulation wizard take any of the following steps:

The first page of the wizard is the Create a Host Simulation Trace page, which contains the following fields:

Project
Use this field to specify the target project for the host simulation trace file.
Name
Use this field to supply a name for the host simulation trace file. The default name is ProjectNameTrace_num. WhereProjectName is the name of the target project, and num is a number appended if the base file name already exists.
Location
This field displays the destination location for the host simulation trace file. It cannot be modified.
Description
Use this field to add any optional description you want.

The second page of the wizard is the Choose Connection page. Use this page to select which connection within the project to use for recording the trace file. The project's default connection is the default for recording.

After clicking Finish in the wizard, the host simulation recorder finds an unused port from the HATS Host Simulation preferences TCP/IP port range settings to use and sets itself up as a proxy between the real host and the HATS host terminal. See Using HATS preferences for more information. Next the host terminal is displayed.

Using the host terminal, interact with the host system to record the scenario for this trace file. You can use the Stop Host Simulation Recording toolbar icon to stop recording and the Restart Host Simulation Recording toolbar icon to restart recording.

When you stop recording you are given the options to save the trace file and whether to close the host terminal window. Saved trace files appear in the HATS Projects view under the target project in a folder named Host Simulations.

Host simulation editor

To open the host simulation editor for a host simulation trace file, double-click the file in your project's Host Simulations folder. This editor allows you to browse trace information and modify playback settings. There are two tabs in the host simulation editor, the Overview tab and the Source tab.

Overview tab

There are two sections on the Overview tab, the General Information section and the Playback Settings section.

General Information section

The General Information section displays the trace file name and description, the date and time it was last modified, and the name of the connection it is associated with.

Playback Settings section

In this section you can modify playback settings and click a button that will playback the trace on the host terminal. The following playback settings can be modified:

TCP/IP Port Range
During trace playback, HATS host simulation function listens on a range of ports to simulate host communication with the host terminal or your HATS application. Multiple ports are used to allow trace playback on multiple sessions concurrently. Default values are prefilled using the HATS host simulation preferences settings. See Using HATS preferences for more information.
Time Delay Settings
Use these values, Delay, Minimum (ms), and Maximum (ms) to set the time delay (in milliseconds) for host simulation to wait during playback before responding to requests from the host terminal or your HATS application. Default values are prefilled using the HATS host simulation preferences settings and can be modified here. See Using HATS preferences for more information.
Playback on Host Terminal button
Click this button to open a host terminal window and playback the host simulation trace file.

Source tab

The Source tab displays the source of the host simulation trace file in an XML editor.

Recording in the runtime environment

In the Web environment, the administrator can use the HATS administrative console to enable host simulation recording during runtime. See Set Trace Options for how this is done.

In the rich client environment, the user can use the workbench preferences to enable host simulation recording during runtime. See Troubleshooting preferences for how this is done.

Playback options

The following table summarizes the various host simulation playback options.

Table 8. Host simulation playback options
Environment Launch action Capabilities
Host terminal

In the HATS Projects view, right-click the host simulation file and select Playback on Host Terminal.

View playback
Host terminal

In the HATS Projects view, double-click the host simulation file. In the host simulation file editor, click the Playback on Host Terminal button.

View playback
Host terminal

In the HATS Projects view, double-click a connection. In the connection editor on the Basic tab, select Use Host Simulation instead of the live connection and select the trace from the drop-down.

In the HATS Projects view right-click the connection and select Open Host Terminal.

Create screen captures, screen events, and screen transformations.

Create and test macros.

Local test runtime

(Web, EJB, and rich client applications)

In the HATS Projects view, double-click a connection. In the connection editor on the Basic tab, select Use Host Simulation instead of the live connection and select the trace from the drop-down.

Run the application in the local test environment.

Test the HATS application in the local test environment.
Deployed runtime

(Web, EJB, and rich client applications)

In the HATS Projects view, double-click a connection. In the connection editor on the Basic tab, select Use Host Simulation instead of the live connection and select the trace from the drop-down.

Export and deploy the application.

Deploy the HATS application as a demonstration.

Importing and exporting trace files

A non-supported stand alone tool named, Host Simulator, has been available for download to allow users to perform some of the functions that are now available with the host simulation function built into HATS V9.5. You can import both the trace files created by the stand alone Host Simulator tool and the trace files created by the HATS host simulation function. To import the trace files created by the stand alone Host Simulator tool, from the menu bar select File > Import > HATS > Host Simulator trace into HATS. To import the trace files created by the HATS host simulation function, from the menu bar select File > Import > HATS > HATS Host Simulation. In the wizard, click the Add button to browse the file system and select the trace file to import. Next, select the Host Simulations folder within the destination project. If importing a trace file created by the stand alone Host Simulator tool, select the connection within the project with which to associate the trace file. Click Finish.

To export a HATS host simulation trace file, from the menu bar select File > Export > HATS > HATS Host Simulation. Next, select the trace file to export, browse to select the destination, and click Finish.