Associating a Function with a Category - WinRunner

Any function that you add to the Function Generator should be associated with an existing category. You make this association using the generator_ add_ function_ to_ category TSL function. Both the function and
the category must already exist.

This function has the following syntax:

generator_add_function_to_category ( category_name, function_name );

  • category_name is the name of a category in the Function Generator. It can be either a standard category, or a custom category that you defined using the generator_add_category function.
  • function_name is the name of a custom function. You must have already added the function to the Function Generator using the function, generator_add_function.

To associate a function with a category:

  1. Open the Function Generator. (Choose Insert > Function > From Function Generator, click the Insert Function from Function Generator button on the User toolbar, or press the INSERT FUNCTION FROM FUNCTION GENERATOR softkey.)
  2. In the Category box, click function table.
  3. In the Function Name box, click generator_add_function_to_category.
  4. Click Args. The Function Generator expands.
  5. In the Category Name box, enter the category name as it already appears in the Function Generator.
  6. In the Function Name box, enter the function name as it already appears in the Function Generator.
  7. Click Paste to paste the TSL statement into your test script.
  8. Click Close to close the Function Generator.

A generator_add_function_to_category statement is inserted into your test script. In the following example, the “check_my_button_label” function is associated with the “my_button” category. This example assumes that you have already added the “my_button” category and the “check_my_button_label” function to the Function Generator.

generator_add_function_to_category ("my_button", "check_my_button_label");

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

WinRunner Topics