Capturing and Replaying Form Input on Text-Based Systems

Purpose

This feature has been designed to allow Zim application developers to capture form input and later replay the captured keystrokes to simulate typing at the keyboard. The ability to replay form input can aid in testing and debugging applications, and also in producing product demonstrations.

FORM SET SAVE and FORM SET INPUT

There are two commands used to control the capturing and replaying of form input:

 

FORM SET SAVE

FORM SET INPUT

Example

The following steps will produce a form input script for a Zim session that tests a specific section of an application:

  1. Before starting the application, execute the command FORM SET SAVE ON to initiate capturing.

  2. Start the application and proceed normally.

  3. After the application has terminated, execute the command FORM SET SAVE OFF to terminate capturing.

  4. At this point, the script file zfmkeys contains all of the keystrokes you typed during FORM INPUT.

  5. To replay the form input script, return to the point where you executed the FORM SET SAVE ON command and execute instead the command FORM SET INPUT ON to initiate replay.

  6. Then start the application and watch the script replay.

  7. When complete, execute the command FORM SET INPUT OFF to terminate replay.

Other Terminal Input

The capture and replay commands described above affect only FORM INPUT and not other kinds of terminal input processed by Zim.

The following commands are not affected:

Switching Terminals or Platforms

The form input script file can be produced on one terminal and replayed on another, even if the terminal definitions are dissimilar.

For example, on a UNIX platform, a script file produced by capturing keystrokes from a terminal defined (using ZIMTCAP) as a VT100 terminal, could be replayed later on a terminal defined as an ANSI terminal.

In other words, the script file format is independent of the terminal used to create it.

However, the script file format is dependent on the platform on which it was created. For example, a script file used on a UNIX system cannot currently be replayed on a VAX/VMS system or on a Microsoft Windows system.

Using Multiple Script Files

The form input capture and replay features work with a single script file called zfmkeys. At most one script file can be in use at any time.

However, it is possible to work with many script files simultaneously by using the file copying facilities of the operating system.

 

For example, after producing a script file you could make a copy of it named  myscript.1.

FORM SET SAVE ON

... <other commands>

FORM SET SAVE OFF

SYSTEM "cp zfmkeys myscript.1"

 

The SYSTEM command above uses the UNIX/XENIX/QNX "cp" command to make a copy of the script file. In this manner, many different script files could be produced.

Later, a particular script file could be replayed by first restoring it as the zfmkeys file.

SYSTEM "cp myscript.1 zfmkeys"

FORM SET INPUT ON

... <other commands>

FORM SET INPUT OFF

Caveats


Capturing Should not be Turned on while Replay is on

FORM SET SAVE ON should not be executed while FORM SET INPUT ON is active, otherwise replay will be turned off and capturing initiated (which will erase the old script file).

Replay Should not be Turned on while Capturing is on

FORM SET INPUT ON should not be executed while FORM SET SAVE ON is active, otherwise capture will be terminated and replay initiated.

Replay Should be Turned off once the Last Keystroke in the Script File has been Replayed

FORM SET INPUT OFF should be executed once the script file has been exhausted.