Sunday, 18 July 2010

Correlating dynamic parameters

Once the script has been recorded using Fiddler tester can start correlating web requests. The aim of this process is to ensure that scripts will handle user session and other dynamic parameters in the same way as web browser would do.

Additionally to session id web application can use wide range of other dynamic parameters generated on-the-fly. For example in an e-commerce application each customer might be assigned a unique shipping cart ID which could contain a unique list of items in the shopping basket.

Since the shopping cart id is generated only after the customer adds the first item to the basket it cannot be known prior to the execution time. WebTest script will have to capture shopping cart id generated by the server and use it while adding products to the shopping basket.

If the script correlation were skipped performance test could still add items to the shopping cart created by web application during script recording. Depending on the tested application this can result in:
  • no obvious functional error but only one recorded shopping card id is shared between all simulated users skewing test result
  • http error page with a http error status code (i.e. 500)
  • custom error page which might appear as a pass (based on the http response status code) but in fact it is a page containing error message

Performance tester needs to pay close attention to all dynamic parameters and sometimes discuss their purpose/importance with developers to ensure that realistic load is generated. It is probably a good strategy to assume that all requests failed (even if passed according to http status code) and verify each of them manually.

In general script correlation can be broke down into fore stages process:
The real benefit of using Fiddler to record VSTS WebTest becomes apparent during first two stages of the script correlation process.

When business processes are recorded in VSTS only web requests are captured by the recording engine. Using VSTS alone tester would have to execute the script multiple time each time getting slightly further in the correlation process.
If application data is single use only correlation can become even more tedious and time consuming.

On the other hand Fiddler recording contains both request and response for the whole recorded business process. Once dynamic parameters have been identified in request it can be searched for within all server responses using Fiddler and located within seconds.

For the full guide to developing VSTS WebTests please refer to the Using Fiddler with VSTS.

No comments:

Post a Comment