Testing the CheckBoxProxy sample
This proxy sample explains how to create a simple proxy class and a new TestObject for a CheckBox control
Test the check box application sample to view the default value of the control
- Open the JCheckBoxApp.java file that is available in the imported CheckBoxApp project folder.
- Open the Functional Test perspective.
- Run the JCheckBoxApp.java script. The sample application is displayed.
- To test the button control, record a functional test script and click the button control of the sample application.
- Open the test object map. Notice that the Proxy Class Name
(#proxy) and Test Object Class Name (#testobject)
property under Administrative properties for the check box is
.java.jfc.JCheckBoxProxy
andToggleGUITestObject
respectively. This is the default value for this control. - Also, notice that the
check()
anduncheck()
methods are unavailable for the checkbox TestObject.
Extended Capabilities: Creating a new TestObject
In this sample proxy, a new TestObject is created and mapped to CheckBoxProxy proxy to add
the
check()
and uncheck()
methods. This proxy also extends
the public String getTestObjectClassName()
proxy method to return the
canonical name of the newly created TestObject so that all javax.swing.JCheckBox controls
have new TestObjects. Note: You create a new TestObject only when you want the control to
expose new methods that are not available in the existing Rational® Functional Tester TestObject.
Deploy the binary files
- Open the Java perspective.
- From the CheckBoxProxy and ExtendedToggleGUITestObject projects, copy the
CheckBoxProxy.jar
,CheckBoxProxy.rftcust
,ExtendedToggleGUITestObject.jar
, andExtendedToggleGUITestObject.rftcust
to the customization directory. The default location for the customization directory is C:\ProgramData\IBM\RFT\customization .Note: You must manually add theExtendedToggleGUITestObject.jar
file to the Rational® Functional Tester project, if a compilation error is displayed in the Rational® Functional Tester script for the check box control.
Deploy the binary files
Copy the CheckBoxProxy.jar
, CheckBoxProxy.rftcust
,
ExtendedToggleGUITestObject.jar
, and
ExtendedToggleGUITestObject.rftcust
files to the customization directory
and restart Rational® Functional Tester to test the sample
application-under-test (AUT).
Verify the proxy and TestObject deployment
You can test the javax.swing.JCheckBox control, which the CheckBoxApp AUT provides.
- Restart Rational® Functional Tester
- After you deploy the proxies, the administrative property values change to the
following for the checkbox TestObject:
Administrative property Value Proxy Class Name (#proxy) SDK.Sample.ExtendedCheckBoxProxy
Test Object Class Name (#testobject) ExtendedToggleGUITestObject
- After you deploy the proxies, the
check()
anduncheck()
methods are available for the checkbox TestObject.