Mapping a Custom Object to a Standard Class - WinRunner

A custom object is any GUI object not belonging to one of the standard classes used by WinRunner. WinRunner learns such objects under the generic “object” class. WinRunner records operations on custom objects using obj_mouse_ statements.

Using the GUI Map Configuration dialog box, you can teach WinRunner a custom object and map it to a standard class. For example, if your application has a custom button that WinRunner cannot identify, clicking this button is recorded as obj_mouse_click. You can teach WinRunner the “Borbtn” custom class and map it to the standard push_button class. Then, when you click the button, the operation is recorded as button_press.

Note that a custom object should be mapped only to a standard class with comparable behavior. For example, you cannot map a custom push button to the edit class.

To map a custom object to a standard class:

  1. Choose Tools > GUI Map Configuration to open the GUI Map Configuration dialog box.
  2. To map a custom object to a standard class

    The Class List displays all standard and custom classes identified by WinRunner.

  3. Click Add to open the Add Class dialog box.
  4. Click the pointing hand and then click the object whose class you want to add. The name of the custom object appears in the Class Name box. Note that this name is the value of the object’s MSW_class property.
  5. Click OK to close the dialog box. The new class appears highlighted at the bottom of the Class List in the GUI Map Configuration dialog box, preceded by the letter “U” (user-defined).
  6. Click Configure to open the Configure Class dialog box.
  7. Class dialog box

    The Mapped to Class box displays the object class. The object class is the class that WinRunner uses by default for all custom objects.

  8. From the Mapped to Class list, click the standard class to which you want to map the custom class. Remember that you should map the custom class only to a standard class of comparable behavior.
  9. Once you choose a standard class, the dialog box displays the GUI map configuration for that class.

    You can also modify the GUI map configuration of the custom class (the properties learned, the selector, or the record method). For details, see “Configuring a Standard or Custom Class”.

  10. Click OK to complete the configuration.
  11. Note that the configuration is valid only for the current testing session. To make the configuration permanent, you should paste the TSL statements into a startup test script. See “Creating a Permanent GUI Map Configuration” for more information.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

WinRunner Topics