This proxy sample explains how to extend a proxy to add more control
properties and control data.
Extended Capabilities
Note: Currently there is no separate
proxy for javax.swing.JFormattedTextFieldProxy. Properties
that are specific to the JFormattedTextFieldProxy control,
for example, format string and unformatted value are not available for the getProperties() method.
These values are also unavailable for data verification points.
Add
more control properties
Along with the default control properties
that are provided, you can add more control properties by extending the java.util.Hashtable
getProperties() and Object getProperty(String propertyName) proxy
methods.
Add more control data
Along with the default control
data types that are provided, you can add more control data by extending the java.util.Hashtable
getTestDataTypes() and ITestData getTestData(String testDataType) proxy
methods.
Deploy the binary files
Copy the JFormattedTextFieldProxy.jar and JFormattedTextFieldProxy.rftcust files to the customization directory and restart Functional Tester to
test the sample AUT.
Verify the additional control properties that are added
You
can test the javx.swt.JFormattedTextField control, which the JFormattedTextFieldApp
AUT provides.
- Before you deploy the proxies, run testObject.getProperty("unformattedValue").
This throws the error message, Properties not found.
- After you deploy the proxies, running testObject.getProperty("unformattedValue") returns
a valid property.
Verify the additional control data that are added
- Before you deploy the proxies, data verification on the javx.swt.JFormattedTextField
control returns only two data types.
- After you deploy the proxies, an additional data type Unformatted Value
is included. You can also verify that the additional data type is present
by using the getTestDataTypes() and getTestData("value") APIs.