Highlighted
Absent Member.
Absent Member.
1195 views

TrueClient and stdlib.h

Jump to solution

Hello!

 

I try to add a standard C library stdlib.h to my TruClient project. I need it for a system function to launch the external application during test.

 

My globals.h file:

#include <TruClient.h>
#include <stdlib.h>

 

When I try to compiler this project I get the output errors:

...\vugen\scripts\tryc\tryc\\pre_cci.c: C:\\Program Files (x86)\\HP\\LoadRunner\\include/stddef.h:2: error: invalid use of `int'
...\vugen\scripts\tryc\tryc\\pre_cci.c: C:\\Program Files (x86)\\HP\\LoadRunner\\include/stddef.h:2: error: empty declaration

 

Is it possible to use TruClient like this?

Thank you!

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: TrueClient and stdlib.h

Jump to solution

Hi Alex, 

 

Please find additional instructions how to call external C functions in TruClient protocol and example script using C functions in the following knowledge document: 

https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM1221460

 

For example in the file SampleFunction.c in the function you can only add system("command text"); for example: 

 

system("C:\\Error.png");
system("C:\\SysinternalsSuite\\DiskView.exe"); 

 

For me it is replaying and opening the picture and starting the program without adding additional headers, however we cannot guaranty that using system function during a load test will work properly as this is outside the scope TruClient protocol was developed to be used.

 

I hope the information provided was helpful for you. 

 

I hope you will find this information useful.

 

Kind regards, 

Vesela 

 

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: TrueClient and stdlib.h

Jump to solution

Hi Alex, 

 

Please find additional instructions how to call external C functions in TruClient protocol and example script using C functions in the following knowledge document: 

https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM1221460

 

For example in the file SampleFunction.c in the function you can only add system("command text"); for example: 

 

system("C:\\Error.png");
system("C:\\SysinternalsSuite\\DiskView.exe"); 

 

For me it is replaying and opening the picture and starting the program without adding additional headers, however we cannot guaranty that using system function during a load test will work properly as this is outside the scope TruClient protocol was developed to be used.

 

I hope the information provided was helpful for you. 

 

I hope you will find this information useful.

 

Kind regards, 

Vesela 

 

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

Highlighted
Honored Contributor.
Honored Contributor.

Re: TrueClient and stdlib.h

Jump to solution

The issue could be due to multiple definition of the same_SIZE_T_DEFINED.

 

Please try the code below before including C headers.

 

#ifndef _SIZE_T_DEFINED

#ifdef size_t         

#define _SIZE_T_DEFINED     

#endif

#endif

 

Thanks,

Oded

0 Likes
Highlighted
Frequent Visitor.

Re: TrueClient and stdlib.h

Jump to solution

hi, I also would like to know how to use system function on my VuGen script, what did you do to achieve this?

0 Likes
Highlighted
Visitor.

Re: TrueClient and stdlib.h

Jump to solution

wow this worked like a charm in http protocol 

Thanks Bro

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.