Executing Function lib first
I am new to a project, where the framework is already built and have many scripts.
In each script we have associated one functional library, when i execute the script the functional library is getting executed, is it possible?
Action script name: TestLogin
Functional lib name: Login.qfl
When i add a breakpoint in Login.qfl at line 1, and when i start execution from script the breakpoint (in fun lib) got hit, then the execution control comes to script.
(we are not calling any function from script, by default the execution control goes to fun lib first then coming to script)
any suggestion please, how can we do this?
As per my knowledge, If Function library is already associated to the script, then it will load the functions of function library and then it will execute the script. Irrespective of function call, if library is associated to the script, It will load whole function library.
Whenever we run a test, the function library(ies) associated is/are "read" first then the script/actions.
That is why it hit on your breakpoint.
Dont worry bout it though because the function declared in your libraries are not executed (not unless you have explicit calls inside it i.e. a line that just calls a function).
It will be executed later when your script calls to any of those that were "read" early at the start of the execution.
One can associate function library to script in two ways - at design time and at run time
1. At design time - Go to File>Settings>Resources and associate function library by specifying its path
2. At run time - LoadFunctionLibrary "<path of library file>"
If the library is associated at design time, then it will get executed first.
If you want to have control over when the library gets executed, load it at run time using 'LoadFunctionLibrary ' statement.
Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.