Recording New Classes for ActiveX/Visual Basic Controls

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

The process of recording a class involves querying the objects in your application, retrieving information on properties and methods, and then translating the information into 4Test-style prototypes. Silk Test Classic does this automatically for you when you select Record > Class.

We recommend that you create an include file (for example, userclass.inc) for your new class definitions, instead of entering them in vbclass.inc. This way you will not have to update vbclass.inc each time you record new class definitions.

  1. Start your application. If you are recording classes for controls on a web page, navigate to that Web page.
  2. Open the include file you created for your new class definitions. For information on how to load class definition files, see Loading Class Definition Files.
  3. Click Record > Class > Scripted to open the Record Class dialog box.
  4. Position the mouse pointer over the control for which you want to record a class.
  5. When the correct name displays in the Window field, press Ctrl+Alt. Properties and methods for that class are displayed in the Record Class dialog. Do not edit the tag name in the Tag field.
  6. Click the Derived From drop-down menu to see the list of available 4Test classes. Then proceed as follows:
    • If there is a class type available that maps directly to your object, choose it. For example, if your object is a SuperListBox, you might choose ListBox (note that similarly named objects might not behave as expected). Your object will inherit all the standard 4Test methods and properties defined for a list box.
    • If there is not a class type that maps directly to your object, choose Control, which is a generic class.

    See winclass declaration and derived class for more details.

    The Agent provides special handling for certain classes of objects. If your object is one of these types, but does not work correctly while you are testing your application, you will also need to class map the object after completing this procedure. For more information, see Options for Non-Graphical Custom Controls.

  7. Click Paste to Editor to paste the new class into the include file.
  8. Repeat this process for every type of control in your application that does not appear in the list of classes provided. When you are done recording classes, and then click Close.