Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on how can i write user define functions in LoadRunner Script? within the LoadRunner forums, part of the Software Testing category; hi how can i write user define functions in LoadRunner Script? and can u explain below functions? __declspec (dllexpert) char* (char*, char*)...
|
|||||||
|
|||
|
hi
how can i write user define functions in LoadRunner Script? and can u explain below functions? __declspec (dllexpert) char* |
| Sponsored Links |
|
|||
|
hi Swamy,
Yes we can create User-defined functions in LR. But when using User-defined functions to subsitute paramter values, you would have to create a external DLL library for the same. This is achieved by using the syntax u had specified - __declspec(dllexport) char * Both the arguments passed are NULL for this function. An User-defined function could be : __declspec(dllexport) char *GetSysDate(char *, char *) This would return the system date. You could substitute this returned value for a parameter instead. Do revert back incase of any queries..... Cheers.... Bizzzzzare
__________________
Regards, V.Umesh Krishnan QA Consultant |
|
|||
|
Re: how can i write user define functions in LoadRunner Script?
To add my two cents:
Once the .dll is created (in Visual Studio or some other Microsoft Tool) you can use the following command in the LoadRunner script to use the functions directly from the .dll. lr_load_dll("mydll.dll") Then you can call the functions in the .dll directly: date = GetSysDate(char1, char2) Good Luck and let us know if you have any questions regarding this. |
|
|||
|
Re: how can i write user define functions in LoadRunner Script?
Quote:
|
| The Following User Says Thank You to bnswamyATP For This Useful Post: | ||
|
|||
|
Re: how can i write user define functions in LoadRunner Script?
char1 and char2 and the names of my variables that I'm passing into the function. These variables could've been named anything I wanted to name them.
|
|
|||
|
Re: how can i write user define functions in LoadRunner Script?
You can also define other user defined functions within a header file to be called within the script. This process is followed in most of the situations as working with DLL is costlier for simple functions which can be created within a header file.
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can you write your own utility functions in QTP | Geek_Guest | QTP | 1 | 12-21-2007 07:20 PM |
| Script Interaction User Defined Functions | rashmi1 | Testing Templates | 0 | 08-31-2007 08:40 PM |
| How do we write script in expert view | Geek_Guest | QTP | 0 | 06-08-2007 10:25 PM |
| Any help available for starters with user defined functions | vjlaxmi | QTP | 2 | 04-04-2007 10:43 AM |
| how should we write the script? | abraham_ahmed | Testing Issues | 4 | 02-15-2007 05:05 AM |