Accessing Native Methods for Predefined Java Classes

This functionality is supported only if you are using the Classic Agent.

In some situations, you might want to access the native methods for predefined Java classes, for example if a particular function was not supported in 4Test, but could be performed using a native method. You can access the native methods for controls that are part of predefined Java classes by re-recording the class for the control.

To access native methods for predefined Java classes:
  1. Start your Java application or applet, and Silk Test Classic.
  2. Open the predefined class definition file, javaex.inc, and comment out the predefined definitions for classes whose native methods you want to access.
  3. Create a new include (.inc) file or open an existing include file for storing your new class definitions.
  4. Click Record > Class > Scripted to open the Record Class dialog box.
  5. Position the mouse pointer over the predefined control for which you want to record a new class.
  6. When the correct name displays in the Window field, press Ctrl+Alt. Methods and properties for that class are displayed in the Record Class dialog box.
  7. Click the Derived From list box to see the list of available 4Test classes. If there is a class type in the list that maps directly to your object, choose it. If not, choose AnyWin, which is a generic class. See winclass declaration and derived class for more details.
  8. Click Paste to Editor to paste the new class into the include file.
  9. Repeat this procedure for each predefined class whose native methods you want to access. When you are finished recording classes, click Close.
  10. Load the class include file that stores your new class definitions.