Skip to main content

Web_add_header and web_add_auto_header usage in Loadrunner

Web_add_header:

Web_add_header function is used to add header only to HTTP request that follows it.



Example:

web_add_header("Cookie""{Cookie_ID}");
web_add_header("Pragma""no-cache");

web_url("webmail",
    "URL=http://{URL}/etc/apps/webmail/",
    "Resource=0",
    "RecContentType=text/html",
    "Referer=",
    "Snapshot=t1.inf",
    "Mode=HTML",
    LAST);

web_add_header("Cookie""{Cookie_ID}");
web_add_header("Pragma""no-cache");

web_url("webmail_3",
    "URL=http://{URL}/etc/apps/webmail/?_task=mail&_action=getunread&_remote=1&_unlock=0&_={TimeStamp}",
    "Resource=0",
    "RecContentType=text/plain",
    "Referer=http://{URL}/etc/apps/webmail/?_task=mail",
    "Snapshot=t2.inf",
    "Mode=HTML",
    LAST);

web_add_auto_header:

Web_add_auto_header function is used to add header to all the consecutive HTTP requests.

Web scripts usually send the standard header requests automatically for each request. If you need additional headers to be sent then you can use web_add_header or web_add_auto_header.

web_add_header only sends to the HTTP request that follows it, whereas web_add_auto_header sends to all the succeeding requests.

Web_add_header and web_add_auto_header is automatically generated in your script, if you enable this in Record -> recording options->Advanced->Headers->Record Headers not in list.

Example:

web_add_auto_header("Cookie""{Cookie_ID}");
web_add_auto_header("Pragma""no-cache");

web_url("webmail",
    "URL=http://{URL}/etc/apps/webmail/",
    "Resource=0",
    "RecContentType=text/html",
    "Referer=",
    "Snapshot=t1.inf",
    "Mode=HTML",
    LAST);

web_url("webmail_3",
    "URL=http://{URL}/etc/apps/webmail/?_task=mail&_action=getunread&_remote=1&_unlock=0&_={TimeStamp}",
    "Resource=0",
    "RecContentType=text/plain",
    "Referer=http://{URL}/etc/apps/webmail/?_task=mail",
    "Snapshot=t3.inf",
    "Mode=HTML",
    LAST);




Comments

Popular posts from this blog

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 bing.com 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.

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