This proxy sample extends the processSingleMouseEvent() proxy API to modify the recording behavior of a spin control. Although a spin control has two buttons and one text control as its children, from a testing perspective it must be treated as a single control with no children appearing in the TestObject Map. (In the TestObjectMap, the buttons and the text are treated as SubItems.) The processSingleMouseEvent() implementation sets methods with suitable SubItems, for example atButton("UP") or atButton("DOWN") as parameters for recording. Also note that although there are child objects for the spin control, you must make sure they are not listed as separate TestObjects. Therefore, the getChildAtPoint() and getChildren() APIs are extended to return null values. These child objects are treated as SubItems.
Playback Support
To support playback for each SubItem that is introduced during recording, Functional Tester looks for the screen rectangle for each SubItem through the proxy. The SubItem rectangle can be provided by extending java.awt.Rectangle getScreenRectangle(Subitem subitem) proxy API.
Copy the JSpinnerProxy.jar and JSpinnerProxy.rftcust files to the customization directory and restart Functional Tester to test the sample application-under-test (AUT).
You can verify the recording behavior of the spin control: