Parameterizing Get/Post Data Using Text

 

How do I get to the Parameterization screen?

 

Suite Manager >> Continue with Web Performance Testing >> Select load test from left-side tree view >> Click 'Edit' link under HTTP Parameters from the right panel.

 

Steps to Parameterize Get/Post Data using Text option

  1. From the left side panel of the HTTP Parameters screen, select the URL to be parameterized.

  2. Click on any of the required tabs such as Parameters, Cookies or Mime which contains the value to be parameterized.

  3. From the row which contains the value to be parameterized, choose the list component from the Fetch Data From column. The 'Fetch Data From' column displays options such as Dataset, Cookie, Text, Element, Javascript, Constant, URL, Variable and Random Data.

  4. From this list, choose the option as Text to fetch the values from a previous response body. This will display the Text Information screen.

  5. In this screen, select the check box Use Expression to support regular expressions. To know the details of using Regular Expressions, refer the following link.

  6. Enter the expression in the Expression field.

  1. Example 1: For example to extract userid from the below html you have to give the expression as

    Expression:
    Server Configuration[\s\S\r\n]*\?userid=Suffix: >

<HTML>
...
...
...
<TR><TD>Server Configuration </TD>
<TD><A HREF=serverconfig.html?userid = AABCXYZKDFGGS12R>Config </A>
...
...
...
</HTML>

  1. Example 2: For example to extract the text ../jsp/MySCPage.jsp from href tag in the below html you have to give the expression as

Expression: Details[\s\S\r\n]*href=\")+(?=[\S]*MySCPage.jsp

 

<HTML>

...

...

...

"Log the Meeting Details<td width=\"18\"><img src=\"../images/top_right.gif\"></td> </tr></table><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><td bgcolor=\"#C6D3C9\" border=\"0\" width=\"1\"><table width=\"0%\" border=\"0\" align=\"right\" cellpadding=\"2\" cellspacing=\"0\"><tr><td align=\"center\"><a href=\"../jsp/MySCPage.jsp?userName=d6DQ9NeVCe776Qlf68swt4M&limit=Yes\">Home</a>

...

...

...

</HTML>

  1. If you do not require regular expression support, enter the prefix text in the Prefix field.
  2. Enter the suffix text in the Suffix field.
  3. Click the Apply button. This fill the Value column.
  4. Click the Save button again in the HTTP Parameters screen to save the changes. The first occurrence of the text in between the specified prefix text or expression text and the suffix text will be dynamically substituted for the selected parameter or cookie or mime type.


Copyright © 1999, AdventNet Inc. All Rights Reserved.