Modifying the Default Function in a Category - WinRunner

In the Function Generator, each function category has a default function. When you generate a function by clicking an object in your application, WinRunner determines the appropriate category for the object and suggests the default function. For most Context Sensitive function categories, this is a get function. For example, if you click a text box, the default function is edit_get_text. For Analog, Standard and Customization function categories, the default is the most commonly used function in the category. For example, the default function for the system category is invoke_application.

If you find that you frequently use a function other than the default for the category, you can make it the default function.

To change the default function in a category:

  1. Choose Insert > Function > From Function Generator or click the Insert Function from Function Generator button on the User toolbar to open the Function Generator dialog box.
  2. In the Category list, select a function category. For example, if you want to view menu functions, select menu.
  3. In the Function Name list, select the function that you want to make the default.
  4. Click Set as Default.
  5. Click Close.

The selected function remains the default function in its category until it is changed or until you end your WinRunner session. To permanently save changes to the default function setting, add a generator_set_default_function statement to your startup test. For more information on startup tests, see “Initializing Special Configurations.”

The generator_set_default_function function has the following syntax:

generator_set_default_function ( category_name, function_name );

For example:

generator_set_default_function ("push_button", "button_press");

sets button_press as the default function for the push_button category.

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

WinRunner Topics