0% found this document useful (0 votes)
44 views

Function and End Function Statements.: Functions

A function is a set of coded steps that perform a particular task. A function procedure contains VBScript statements enclosed by Function and End Function statements. Functions can be created to perform operations not available for a test object class, and return a value by assigning it to the function name. A function can take arguments passed to it, and always returns a variant value. Functions are created by opening a function library file, pasting the function code, and saving with a .qfl extension. The function library is then associated with a test by browsing to its location in the test settings and resources.

Uploaded by

gouthamstrikes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Function and End Function Statements.: Functions

A function is a set of coded steps that perform a particular task. A function procedure contains VBScript statements enclosed by Function and End Function statements. Functions can be created to perform operations not available for a test object class, and return a value by assigning it to the function name. A function can take arguments passed to it, and always returns a variant value. Functions are created by opening a function library file, pasting the function code, and saving with a .qfl extension. The function library is then associated with a test by browsing to its location in the test settings and resources.

Uploaded by

gouthamstrikes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

FUNCTIONS

A Function is a set of coded steps that perform a particular task.


A Function procedure is a series of VBScript statements enclosed by the
Function and End Function statements.
We can create a Function, and we can call the function from the Test
We can create our own user-defined functions to perform operations that are not
normally available for use with a particular test object class.
A Function returns a value by assigning a value to its name in one or more
statements of the procedure.
The return type of a Function is always a Variant.
A Function procedure can take arguments (constants, variables, or expressions
that are passed to it by a calling procedure).

---------------------------------------------------------------------------------------Syntax :
Function FunctionName ()
------------------------------------------------------End Function

---------------------------------------------------------------------------------------Creating the Function Library


1. Open QTP and Create Function Library

File - > New - > Function Library

2. Paste the Function into the Function Library Window


3. Save the Function Library

File - > Save (Save the Library in Concerned Location)

4. Function Library will save the file with extension .qfl (Quick Test
Function Library)

---------------------------------------------------------------------------------------Associating the Function Library to the Test

1. File - > Settings - > Resources - > Browse the Function Library
from External Location - > OK
2. Associating Function Library in the Run Time
ExcuteFile Path Name

You might also like