Highlighted
Contributor.
Contributor.
528 views

Executing Function lib first

Hi All,

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?

eg:

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?

0 Likes
4 Replies
Highlighted
Contributor.
Contributor.

Hi,

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.

Thanks,

Kalyani

 

 

 

 

Highlighted
Contributor.
Contributor.

Thank you Kal for the response.

if we use fun lib with .qfl extension then its working, not with .vbs extension.

0 Likes
Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..

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.

0 Likes
Highlighted
Absent Member.
Absent Member.

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.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.