Java GUI User Input Recording

DESCRIPTION:

Record and replay user input (mouse and key events) in the Java GUI. This is intended primarily for automated testing of the Java GUI.

Java GUI functions are deprecated in Spotfire S+ version 8.1.

USAGE:

javaGuiRecordingPlay(filename)
javaGuiRecordingShowDialog()

REQUIRED ARGUMENTS:

filename
Name of the file containing XML commands specifying events to generate.

VALUE:

No returned value

SIDE EFFECTS:

javaGuiRecordingShowDialog displays the "User Input Recording" dialog, which may be used to generate a file containing XML descriptions of events. javaGuiRecordingPlay reads this type of file and generates corresponding mouse and key events.

DETAILS:

These functions are intended primarily for automated testing of the Java GUI.

The "User Input Recording" dialog has three buttons: Start, Stop, and Save. Press Start to begin recording mouse and key events. Press Stop to end recording. Press Save to launch a file chooser which lets the user specify a file name and saves the recording to a file.

The recorder creates a script containing Delay, KeyPressed, KeyReleased, MouseMoved, MousePressed, and MouseReleased events. These events are stored as XML elements with tags D, KP, KR, MM, MP, and MR respectively, and properties with names corresponding to the arguments of the relevant java.awt.Robot methods.

In addition, the initial width and height of the main Java frame are stored, and the frame is set to the specified size when the script is played. This is necessary to get proper placement of dialogs which are centered in the application area.

Currently we only generate MouseMoved events when there is a MousePressed event in order to keep the file size down. This leads to rough animation with respect to cursor moves. Since a mouse event is only generated on a button press, it is important to include a button press in places such as first-level menu item selection, rather than simply moving down the first-level menu and pressing on the second-level menu.

The script is not currently invariant to font substitutions. If the font changes this will influence layout, which will affect the relevance of the MouseMove locations.

The way in which scripts are generated may change. However, it's expected that the player will not change in such a way that existing scripts will no longer function.

REFERENCES:

SEE ALSO:

EXAMPLES:

javaGuiRecordingShowDialog()
javaGuiRecordingPlay("savedScriptName")