Automatic Parameterization of Requests


"Automatic Parameterization of Requests" feature considerably simplifies the design of tests for pages with dynamic content. Its benefit is that in some cases WAPT Pro can automatically perform actions which you did manually (see the topic Working with Session Variables). You can reduce your manual work on creation of session variables and changing the recorded URLs in the following cases:
a) If you know that some dynamic value is always surrounded by the certain strings on the left and on the right.
b) If you know that dynamic data on your site is kept mainly in the hidden fields of HTML code.

When the program finds dynamic values in responses during recording, it automatically creates the corresponding variables, uses them in subsequent requests and corrects the recorded URLs. During run time WAPT Pro will search for the similar dynamic data in HTML code.

There are 2 ways of search for dynamic data in WAPT Pro.

1. Search for strings between specified boundaries
If you know that some dynamic value is always surrounded by the certain strings on the left and on the right, you can specify those strings and organize the search. For example, you know that the current date is always placed between the same delimiters: "?date=" on the left, and "&" on the right. To organize the search, you should check the option "Search for strings between specified boundaries" on the Parameterization tab of program settings and specify the boundaries. In this example, the left boundary is "?date=" and the right boundary is "&".

2. Extract to variables values of hidden fields in HTML forms
If you know that dynamic data on your site is kept mainly in the hidden fields of HTML code, you can check the option "Extract to variables values of hidden fields in HTML forms" in the Parameterization settings. Then the program will look through all hidden fields of HTML pages during recording to find the dynamic data there.

Below you can see examples how the "Automatic Parameterization of Requests" feature works. Suppose you define the following parameter on the Parameterization tab of program settings:



1. The usage of Search for strings between specified boundaries option

If the HTML code of current web page contains the link site.com/page.html?date=150207&ID=1111, WAPT Pro will find the dynamic value 150207 and create a variable Date1 equal to $Search(?date=,&,1).



It will be used to search for the similar date in the HTML code during run-time.
WAPT Pro will use that variable to define parameters on the next pages:




2. The usage of Extract to variables values of hidden fields in HTML forms option

If the current web page has an HTML form containing the hidden parameter Date, WAPT Pro will create a variable Date1 equal to $Hidden(Date,1).



It will be used to search for the similar date in all hidden fields of HTML pages during run-time.
As in the first example, WAPT Pro will use that variable to define parameters on the next pages.

Next page