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*(char*, char*)
yes, u can write the usedefined functions ...
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 *(char *, 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
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.
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.
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.
I have a website which generates a "session id" and I couldn't find it in correlation both manual as well as in auto as it is a hidden parameter.
If I want to declare a user generated function which will store the session id as string and ignore in the script when it comes.
Please help me regarding this.
Anybody ??