Highlighted
Established Member..
Established Member..
118 views

Creating DLL for common functionality of Code.

Hi Experts,

I found in my performance test script I have some of the functionality which is involved multiple scripts at multiple instances.

I would like to create a library for this common functionality and call this library whenever it is required in script.

Please share your valuable thoughts on this and let me know how to create the library.

Thanks
Ajay Kumar
0 Likes
5 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Creating DLL for common functionality of Code.

One way of working it out is compiling the code to a dll(Microsoft C++).
When in need to use it,
lr_load_dll("c:\\test\\sample.dll");
Absolute path required.
0 Likes
Highlighted
Established Member..
Established Member..

Re: Creating DLL for common functionality of Code.

Thanks for your reply.

I believe thats good start.
Could you please help me giving some example for building dll?

Thanks
Ajay Kumar
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Creating DLL for common functionality of Code.

Hi Ajay,

I do hold any examples as such.
Vugen's guide could be off help here.
Refer to "Calling External Functions" in the Vugen guide.

Hope that helps.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Creating DLL for common functionality of Code.

I dont* hold any samples as such...
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Creating DLL for common functionality of Code.

I am not sure about building a dll fine but can give you another approach. Follow the below steps and try

Record the required Vugen script into various required actions
Cut the complete script and paste into a notepad file
Divide the script into various functions in the notepad as
Action()
{
AB_Nonfunctional_UserLogin()
Statements- - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - -- - - -
Return0;
}
AB_Nonfunctional_UserActions()
{
Statements - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Return0;
}
Save the notepad file with an extension â .Câ
Insert the location of the notepad in the globals.h by including it as
#includeâ D :\\< path of the file.c>â
Run the script where it displays only the functions and no other functions and statements are visible. The complete code will be called from the notepad file to execute the actions.

Hope it helps. 🙂


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.