HP QTP Utility Statements : LoadFunctionLibrary Statement
September 10, 2018
HP QTP Utility Statements : LoadFunctionLibrary Statement
Welcome to this post! – ” HP QTP Utility Statements : LoadFunctionLibrary Statement”.
If you are looking for HP UFT, QTP utility statements and their usages, then you are at right place. This post “HP QTP Utility Statements : LoadFunctionLibrary Statement” consists of concept discussion and usage discussion. Go ahead and enjoy reading…
This discussion will help you prepare well if you are going for the interview and can help you if you need the function to be used in your project test suite.
LoadFunctionLibrary Statement
Abstract
The LoadFunctionLibrary statement is used to load the specified function library..
The statement in itself falls under the category of utility statements and not utility objects.
Before we dig down deep into the usage let’s quickly visit some general questions.
In the interview usually, you might be questioned in different ways like:
- How to call external functions in the test?
- Can you use both LoadFunctionLibrary and ExecuteFile statements one after the other?
- What are the objects and parameters of LoadFunctionLibrary statement?
- Is LoadFunctionLibrary is an object or statement?
Discussion
Whenever you are working in any framework you might come across utilizing external functions in your test. These functions depending on your test cases can be right at point of execution where required as well as with a global scope. To facilitate such functions to be called and loaded in test scripts we use this statement.
You can specify one or more absolute file system paths, relative paths, or HP Quality Center (HP QC) folder paths for both tests and business components.
Points to note here:
- For loading more than one function file, please use a comma delimiter.
- The debugging is allowed throughout the file, once functions are loaded.
Syntax
LoadFunctionLibrary(Path)
Let’s see the parameters and their usage description for this statement:
Argument | Type | Description |
Path | String | The complete file path (or paths) of the function library to load. |
Return Value
Variant.
Example 1
To just load a single function file, use the statement as
'example1 LoadFunctionLibrary myfunctionlib.vbs
Example 2
Below example shows loading multiple function libraries and run the functions.
'load multiple function files. Dim strDefaultLibPath Const strDefaultLibPath = "[QualityCenter\Resources] Resources\UFT Resources\Default\" 'Load the relevant function libraries for the current environment's language LoadFunctionLibrary strDefaultLibPath + "MyCustomFunctins1.qfl", strDefaultLibPath + "MyCustomFunctins2.qfl" 'now call your methods contained within the custom function file mymethod1 Browser("name").Page("some page").WebEdit("password")
This brings us to the end of our discussion on “HP QTP Utility Statements : LoadFunctionLibrary Statement”.
I really hope you have enjoyed reading this short post. If you have any doubt on this please feel free to add your comment below.
And if you like to read more on UFT or QTP Technical Interview Questions please follow below links:
UFT Technical Interview Questions – Set 1
UFT Technical Interview Questions – Set 2
How to Download Resource From QC\ALM?
How to Upload Resource To QC\ALM?
Or if you prefer General Interview Questions please follow below links:
UFT General Interview Questions – Part 1
UFT General Interview Questions – Part 2
If you would like to keep track of further articles on UFT (QTP). I recommend you to SUBSCRIBE by Email and have new UFT articles sent directly to your inbox.