Powered By Blogger

Saturday, October 16, 2010

QTP 11 - About LoadFunctionLibrary

In HP QTP 11 we have a new feature called "LoadFunctionLibrary". This is different from ExecuteFile method. Let's see how it works:

Sample Code:

'--------------------------------------------------------
LoadFunctionLibrary "C:\Automation\Test.vbs"
ShowDate

Test.vbs looks as follows:
'--------------------------------------------------------
Sub ShowDate()

   Msgbox "This is testing " & Now & "."

End Sub
'--------------------------------------------------------



When LoadFunctionLibrary step executes it will load specified library file.


We can load multiple library files at a time using "," seperator.


For example:


LoadFunctionLibrary "C:\Automation\Test.vbs", "C:\Automation\KeyWord.vbs"


In the results window it shows as follows:






 

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Mohan Thanks for explaining on using the QTP 11 new feature LoadFunctionLibrary. Can I call my function libraries in another(like a master library file) & call it in test? The reason is I have few library files & more than 100 tests, this new functionality makes my job easier by calling one library file in every test. Also if I call a Master library file (which embed all other library files) will the user registered functions be shown in intellisense?

    ReplyDelete