Swingcorder's capabilities are centered around playback "scripts", which are simply Java methods containing code that
simulates mouse and keyboard input. For example, a script could be created by recording user input for a Swing
application like the one shown below:
Clicking on the "Clear Group" button results in the creation of Java code like the following:
Swingcorder's intelligent script generation produces Java code that imitates the way a human user might describe user
input ("Find the button labeled 'Clear Group' on the 'AbstractButton' tab and click the button"). Combined with a
simple but powerful API, the result is scripts that are simple but that don't need to be updated whenever minor changes
are made to the Swing application's user interface.
Scripts can be created manually, but are more commonly created automatically through a plugin installed within an
Integrated Development Environment (IDE) such as Eclipse
. A Swingcorder plugin
allows you to record user input and to use the recorded data to generate a script that can recreate the original input.
In this case, for example, the script can mimic the clicking of the "Clear Group" button.
Once a script has been created -- either automatically through a plugin or manually by a programmer -- the script code
can be used to simulate user input. Playback normally occurs in one of two scenarios:
- While a Java programmer is editing / testing / debugging a Swing application locally within an IDE. In this
scenario, playback is normally controlled through the Swingcorder plugin.
- As part of a set of unit tests executed automatically to validate code changes. This typically occurs as part of
continuous integration (CI) processing executed on a build server using Jenkins
or some other CI system. Here script execution is initiated automatically as part of the CI processing.
In other words, the recording and automatic generation of scripts requires the installation of a plugin, while playback
can be accomplished without one.