Adding a Subcategory to a Category - WinRunner

You use the generator_add_subcategory TSL function to make one category a subcategory of another category. Both categories must already exist. The generator_add_subcategory function adds all the functions in the subcategory to the list of functions for the parent category.

If you create a separate category for your new functions, you can use the generator_add_subcategory function to add the new category as a subcategory of the relevant Context Sensitive category.

The syntax of generator_add_subcategory is as follows:

generator_add_subcategory ( category_name, subcategory_name );

  • category_name is the name of an existing category in the Function Generator.
  • subcategory_name is the name of an existing category in the Function Generator.

To add a subcategory to 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_subcategory.
  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 Subcategory Name box, enter the subcategory 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_subcategory statement is inserted into your test script. In the following example, the “my_button” category is defined as a subcategory of the “push_button” category. All “my_button” functions are added to the list of functions defined for the push_button category. generator_add_subcategory ("push_button", "my_button");


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

WinRunner Topics