| || |
Can user find out the name of "LR VScript Script" in runtime?
is there any function available in Load Runner to find out the name of the script or from "C" Language?
In our project, the script name is going to change frequently. In the script, we are displaying the script name in the execution log by using lr_output_message().At present we have hard coded this as a string value. But every build, the script name gets changed. So that we need to update the script again and again.
Can anybody please give me a direction?
Re: Can user find out the name of "LR VScript Script" in runtime?
I don't know of any direct way to do this. I would recommend using dos via "system" to read the current script name from the title of the .usr file in the current script directory. Then fopen the file containing the name and save it to a script var. Here's the first piece - you do the rest.
char *ScriptNameFile = ".\\ScrName.dat";
sprintf(dos_cmd, "dir /b .\\*.usr > %s /w", ScriptNameFile );
This does a dir of "*.usr" files in the current script directory. It outputs any files that match to a file named "ScrName.dat" in the same script folder.