How we can load function libraries at Runtime in UFT? – User friendly Tech help

Loading function libraries at runtime was introduced in QTP-11. This feature enables loading of libraries when step runs instead of at the beginning of Run session.
n
nThis is helpful incase you need only particular set of function libraries based on the environment of AUT.
n
nFor example:- we are doing localization testing of our AUT, so instead of associating all the function libraries to the test, we’ll use only required set of libraries based on localization of AUT and that will be added at the run time.
n
n

n

nSyntax:-
nLoadFunctionLibrary (Path of the function library)

n

n
nExample:-

n

‘Loading function libaries based on the localization of AUT
nDim sLocal
n‘Tkaing value of AUT Enviornment from Datatable or external database
nsLocal= DataTable(“Enviornment_AUT”,1)

n

‘Based on the enviornment concerned library will be laoded at runtime
nIf sLocal=“Dutch” Then
n    LoadFunctionLibrary(“C:FunctionsDutch.qfl”)
nElse
n    LoadFunctionLibrary(“C:FunctionsEnglish.qfl”)
nEnd If
n
nImportant:-

n

    n

  • As we are adding this at Runtime, so it wont be visible in Resources,Missing Resources,To do panes
  • n

  • Performance of UFT can be affected as Function libraries are getting loaded at Runtime
  • n

  • At the end of Run, all the dynamically loaded libraries are unloaded.
  • n

  • Incase function Name is same inthe associated and dynmically loaded libray than Dynamically loaded function will be given preference
  • n

  • Another way of loading libraries at runtime is using “ExecuteFile” statement in vbscript.
  • n

  • ExecuteFile “C:Functions.vbs” (Now all the functions inside this file are available for usage in the script)
  • n

Was this article helpful?
YesNo

Similar Posts