Parameter Value Dynamic Calculation


Testing of dynamic web sites and applications often requires the usage of dynamic values of request parameters. If you do not change the recorded user profiles, WAPT Pro simply repeats all requests that you made during recording, so all virtual users of the same profile send identical requests to the server. However, you can add more reality to your tests by using parameter values generated dynamically at run-time. WAPT Pro can simulate this with the help of various functions. The program provides you with a number of functions for dynamic calculation of request parameters and URL paths at run-time.

Functions can be divided into several groups:

random values (numeric or alphanumeric),
values from list (random or ordered),
values from actual server response (hidden form values and others),
and other functions.

The results of several functions can be also concatenated to form more complicated values. WAPT Pro can also upload files to web server using the POST method with multipart content.

There are two methods to use functions in WAPT Pro:

Request parameter value can be calculated using the combination of functions directly, or
You can define a variable (using functions or other variables) and set a request parameter to use the value.

Note that functions like Parameter from URL or Hidden which obtain values from the actual server response are calculated using the following as an input:

HTML code of the PREVIOUS page when the function is used for calculation of request PARAMETER value, or
HTML code of the CURRENT page when the function is used for defining a VARIABLE.

How to define a formula for calculation of parameter value


The list of request parameters is displayed in request properties (URL Parameters or POST Parameters tab). To define a parameter, you can use functions that parse actual HTML code of response at run-time.



Add..: Opens the Add Parameter dialog where you can create a new parameter and select a function for its calculation.
Remove: Removes selected parameter from the list.
Edit..: Opens the Edit Parameter dialog where you can change parameter name and a function for its calculation.

Name: Here you can change parameter name.
Type: You can select "Formula", "File" or "No Value".

Formula: Use this option if you wish to select some function for calculation of parameter value.
File: Use this option if you need to upload some file (for example, an image file) to the tested server. For details, see the description of $File function.
No Value: Use this option if you need to define a parameter without value.

The following is related to the option Formula.

Formula: Here you can see the visual representation of selected function. This field is accessible only for viewing.
Functions: The list of functions for calculation of the current parameter is displayed in this field. You can define several functions for the same parameter. Results of those functions will be concatenated to form more complicated values.

Add..: Opens the Add Function dialog where you can select a function for calculation of parameter value.

Remove: Removes selected function from the list. (That function will be deleted only from the list of functions for calculation of the current parameter.)
Edit..: Opens the Edit Function dialog where you can edit the selected function or choose another function.
Move Up: Moves selected function one step up in the list (if you defined several functions for the same parameter).
Move Down: Moves selected function one step down in the list.


You can use the following functions for dynamic calculation of parameter values:

  1. Static text
  2. Variable - $Var
  3. Ordered list - $LOrder
  4. Random from list - $LRand
  5. Numeric random - $NRand
  6. Alphanumeric random - $ARand
  7. User number - $UserID
  8. Sequence - $Seq
  9. JavaScript - $JavaScript
  10. Comma Separated Values - $CSV
  11. Cookie - $Cookie
  12. XPath - $XPath
  13. Hidden - $Hidden
  14. Search parameter - $Search
        • As $Search() command
  15. Header - $Header
  16. Parameter from URL - $UrlParam
  17. URL from link - $HRef
  18. URL from Form - $Action
You can test the work of any function by clicking the Test button in the dialog with the function properties. You will see the function value calculated using the recorded server response. If the function is executed with an error, you will additionally see the corresponding error message.

Next page