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

  1. Open the JCheckBoxApp.java file that is available in the imported CheckBoxApp project folder.
  2. Open the Functional Test perspective.
  3. Run the JCheckBoxApp.java script. The sample application is displayed.
  4. To test the button control, record a functional test script and click the button control of the sample application.
  5. 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 and ToggleGUITestObject respectively. This is the default value for this control.
  6. Also, notice that the check() and uncheck() 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

  1. Open the Java perspective.
  2. From the CheckBoxProxy and ExtendedToggleGUITestObject projects, copy the CheckBoxProxy.jar, CheckBoxProxy.rftcust, ExtendedToggleGUITestObject.jar, and ExtendedToggleGUITestObject.rftcust to the customization directory. The default location for the customization directory is C:\ProgramData\HCL\RFT\customization.
    Note: You must manually add the ExtendedToggleGUITestObject.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.
  1. Restart Rational® Functional Tester
  2. After you deploy the proxies, the administrative property values change to the following for the checkbox TestObject:
    Table 1.
    Administrative property Value
    Proxy Class Name (#proxy) SDK.Sample.ExtendedCheckBoxProxy
    Test Object Class Name (#testobject) ExtendedToggleGUITestObject
  3. After you deploy the proxies, the check() and uncheck() methods are available for the checkbox TestObject.