HTTP URL Re-writing Modifier

For web applications that use URL Re-writing to store session ids instead of cookies, this element can be attached at the ThreadGroup level, much like the HTTP Cookie Manager. Simply give it the name of the session id parameter and it will find it on the page and add the argument to every request of that ThreadGroup.

Correlation with HTTP URL Re-writing Modifier:

To use HTTP URL Re-writing Modifier we have to record a scenario where session ids are created. This element will grab the parameter values from previous response. It will find the parameter anywhere it exists on the page, and grab the value assigned to it, whether it’s in an HREF or a form.

Steps:

1. Record the site.

url1

When you run the script it will show session expired in the listener. (View result tree->response data in Html rendered).The result may appear in red as failure.

Check the sample which sends session ids as requests to the server. (Look in the send parameter with request field of the sample). There are two variables- BV_SessionID and BV_EngineID. The values of these session IDs comes from the server in the previous request. So these values are sent back again to the server by the browser as request in this sample. For each run these values change. So we have to replace them dynamically. We will add HTTP URL Re-writing Modifier (pre processor) to this sample which will fetch the session ids from previous sample.

url2

2. Select the sample. Add a HTTP URL Re-writing Modifier (add-> pre processor-> HTTP URL Re-writing Modifier).

In this example there are two session ids as shown in send parameter with request field. Put the session Variable name (here BV_SessionID) in Session Argument Name.

url3

Here we add another HTTP URL Re-writing Modifier for the second session ID. Don’t forget to select the Cache Session Id? Option in the URL re-writing Modifier.

3. Now change the variable values to * in the sample.

url4

4. Save and run the script. The result will be successful.

url5

6 Responses

  1. Hi,

    Thanks a lot for the above article. It really helped me a lot !!!
    I am still having some query regarding correlation:

    1. Correlation can be achieved by both Pre Processors –> HTTP URL Re-writing Modifier and Post Processors -> Regular Expression Extractor??

    2. If yes, then what is the difference between both the process?

    3. I have gone through many links which says that correlation can be achieved by Regular Expression Extractor, so could you please put some light on this.

    Thanks a lot in advance.
    Mayank Panwar.

  2. same question above:

    i am dealing with a URL like this:
    /site/website?S=bemxrfs&W=mc51pww2&N=aqrgiea&A=bwvjpm1

    the S=bemxrfs&W=mc51pww2&N=aqrgiea&A=bwvjpm1
    dynamically change every link that is accessed.

    how do we capture and parameterized this if we are going to use
    HTTP URL Re-writing Modifier?

    thanks

  3. Thanks a lot AlokRanjan Nayak.

  4. Hi,

    Can I use this to remember username and password in login page for the next page?

    Thanks,
    Vitcon

  5. Hi All,

    Can anyone solve my problem please ?

    -By using Badboy I recorded and exported the script to jmeter but after running that script( in jmeter), the data is not saved in database..

Leave a reply to AK Cancel reply