Quick Test provides a Function Definition Generator, which enables you to generate definitions for new user-defined functions and add header information to them. You can then register these functions to a test object, if needed. You fill in the required information and the Function Definition Generator creates the basic function definition for you. After you define the function definition, you can insert the definition in your function library and associate it with your test, or you can insert the definition directly in a test script in the Expert View. Finally, you complete the function by adding its content (code).
To open Function Definition Generator:
Step 1: Make sure that the function library or test in which you want to insert the function definition is the active document. (You can click the document's tab to bring it into focus.) This is because the Function Definition Generator inserts the function in the currently active document after you finish defining it.
Step 2: we need to open new Function Library Page to insert the Function Syntax and to execute the Function.
Step 3: Choose Insert > Function Definition Generator or click the Function Definition Generator button . The Function Definition Generator opens.
Step 4: In the Name box, enter a name for the new function. The name should clearly indicate what the operation does so that it can be easily selected from the Step Generator
Step 5: From the Type list, choose Function or Sub, according to whether you want to define a function or a subroutine.
Step 6: From the Scope list, choose the scope of the function—either Public (to enable the function to be called by any test, or component whose application area is associated with this function library), or Private (to enable the function to be called only from elsewhere in the same function library). By default, the scope is set to Public. (Only public functions can be registered to a test object.)
Note: If you create a user-defined function manually and do not define the scope as Public or Private, it will be treated as a public function, by default.
Step 7: In Preview Screen we can able to see the Functions.
Step 8: Click on OK to insert the Syntax.
No comments:
Post a Comment