Eclipse Testing and Performance Tools Platform Project project has a great write-up on using TPTP’s automated GUI recorder.
TPTP’s Automated GUI Recorder (AGR) works by registering listeners with the SWT’s display instance to record all incoming UI events that directly correspond to user’s actions. The recorder keeps track of the context of the events and generates a script that allows the tool to playback the events in the respective order that the user recorded them. The generated script corresponds to a single test case that is embedded in a test suite which users can use to run in quick mode or standard mode (
AGR gives users the ability to also insert verification hooks based on a view, editor, or a shell. The inserted verification hook corresponds to a JUnit method with a parameter of type org.eclipse.ui.IViewPart, org.eclipse.ui.IEditorPart, or org.eclipse.swt.widgets.Shell. During play back, the recorder will invoke the method corresponding to the verification hook with an argument corresponding to the editor, view, or shell selected by the user