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"
Best practices for test automation in agile software development
Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...
-
Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...
-
Test-Driven Development (TDD) is a software development approach that emphasizes writing automated tests before writing the code. The appr...
-
Artificial intelligence (AI) and machine learning (ML) are transforming the field of software testing by enabling faster and more accurate...