Skip to main content

File operations in loadrunner with examples

In this post I will explain how to capture a value from server response and save to a text file using vugen.

How to capture and save to text file using loadrunner:

First I have recorded the script using and then i searched for IBM. We will get 10 results. I have captured all the 10 values and saved to a file.

Here is the code for that.

    long fp;---Here I have declared fp to store the buffer that captured.
    int i;
    char *SearchValue;
    char ch[1000];

        "RecContentType=text/html", ----------

        "LB/IC=< h2 >=\"",

        SearchValue = lr_paramarr_idx("c_search", i);

Hope, most of the code is self explanatory. If you have any doubts feel free to leave a comment.


  1. i am very new to performance testing..can u please explain each and every line of the above written code.thanks

    1. Hi,

      I suggest you to learn c language and loadrunner and web functions which will help you a lot in understanding the code.

    2. hi sam thanks for your suggestion.yes i do know some basics of c but as you are asking me to learn web functions can i know where can we find these functions as an api so that i can go through.

    3. Download and Install the loadrunner
      and in the help section you will find all the function reference.
      go through following functions
      Loadrunner Functions - which will start with lr_ -
      Web Functions - which will start with web_ -

    4. Thanks a lot i am going through.

  2. Just what I needed Sam, thank you!

  3. Hi Sam,
    Thanks a lot, this helped. I have an additional question on this: how do you combine the iterations results in a file? For ex: I am trying to run two users (i.e. two iterations in VuGen) but I can only see last user's correlated values. How do we not overwrite values in a file? I want to have both users' data in a file if I run 2 iterations.
    Thank you.

  4. Your comment on line:
    long fp;---Here I have declared fp to store the buffer that captured.

    fp is not for storing the buffer that captured. It is declared as a file pointer, which is used to "walk" the file.

  5. Why was the below declaration done ?

    char ch[1000];

  6. Why was the below declaration done?
    char ch[1000]; ??


Post a Comment

Popular posts from this blog

NeoLoad Interview Questions and Answers

Here are some of the interview questions and answers on NeoLoad: What is NeoLoad? NeoLoad is a performance testing tool designed to test different types of web, standalone and mobile applications. What is the difference between Loadrunner, JMeter and NeoLoad? Click here for differences What are the different counters you monitor in NeoLoad? Average Response Time(requests), average response time(pages), average requests/s, average throughput, current response time(requests), current response time(pages), current requests, current throughput, current users count, controller cpu load, controller memory load etc. What are the different type of tools you can integrate with NeoLoad? App Dynamics, CA APM Integration, Dyna trace integration, HP ALM or Quality Center Integration, Java and Jamo Solutions M-eux Test Integration, Jenkins Integration, perfecto mobile integration, selenium integration. What are the different type of Operating systems you can mon