Function library can be associated in design time or run-time depending on the framework used.
To associate the function library at design time
navigate to ‘File > Settings > Resources > Associate Function Library’ option in QTP. Click on '+' button and browse for the file and add it to the Test
To associate the function library at run time, you can use any of the following
1) Automation Object Model (AOM)
'Open QTP
Set objQTP = CreateObject("QuickTest.Application")
objQTP.Launch
objQTP.Visible = True
'Open a test
objQTP.Open "D:\Automation\Test1", False, False
Set objFL = objQTP.Test.Settings.Resources.Libraries
'check if it is already associated, else associate it
If objFL.Find("D:\Automation\FunctionLibrary.vbs") = -1 Then
objFL.Add "D:\Automation\FunctionLibrary.vbs", 1
End
2) using ExecuteFile method.
ExecuteFile "D:\Automation\FunctionLibrary.vbs"
3) using LoadFunctionLibrary method.
LoadFunctionLibrary "D:\Automation\FunctionLibrary.vbs"
AI in Software Testing: How Artificial Intelligence Is Transforming QA
For years, software testing has lived under pressure: more features, faster releases, fewer bugs, smaller teams. Traditional QA has done her...
-
Test-Driven Development (TDD) is a software development approach that emphasizes writing automated tests before writing the code. The appr...
-
Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...
-
Software development is a complex process that requires a high degree of accuracy, efficiency, and speed. One way to achieve these goals i...