Absent Member.
Absent Member.

Load Runner - Correlation values to file

Hello All,


I am doing correlation in my script. This is a server generated number. I am running the script with 100 Vusers. For each time the script is executed one new number is generated by server.


So now, I want to store the server generated data in text file or excel, is it possible? if yes, could you please explain clearly?




2 Replies
Absent Member.. Absent Member..
Absent Member..

Re: Load Runner - Correlation values to file


Not sure if I have understood your problem correctly.


I believe you are already correlating this server returned value which should be written to the logs files (If log is turned ON).

If you have a specific need of writing the values to a file then you have go in for File handling operation to write the output.


Hope this helps

Absent Member.
Absent Member.

Re: Load Runner - Correlation values to file

Yes, it is possible to write the server generated values to a text file using file operations. Refer to the example code to write the values to a file. The same way you can save the value returned to a variable and write to the file.




            long fp;

            fp= fopen("c:\\sample.txt","a");

            lr_save_datetime("%d-%m-%y",DATE_NOW ,"datetime");

            fprintf(fp,"Iteration Number is %s \n",lr_eval_string("{Iteration}"));

            fprintf(fp,"Todays date is %s \n",lr_eval_string("{datetime}"));

            lr_save_datetime("%d-%m-%y",DATE_NOW + ONE_DAY ,"datetime1");

            fprintf(fp,"date after one day  is %s \n",lr_eval_string("{datetime1}"));


            return 0;


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.