Querystring parameters in recorded WebTest?

I have a multi-page webtest that creates a new company. When the registration page is submitted, it ultimately navigates to an address validation page passing the newly created companyId as a querystring parameter. It actually visits this page twice, once for mailto and once for billto addresses.

The recorded webtest includes the querystring parameter (both times), apparently hard-coded to the value passed when the test was recorded.

When I re-run the test, a new companyId will be generated and needs to be passed on to the address validation page. The correct value is passed for the first visit to the address validation page, but it is the hard-coded value from the recorded test that is passed instead on the second visit to the address validation page.Sad

[828 byte] By [kklasman] at [2008-2-15]
# 1
Looking a bit more closely at the results of re-running this test, I see 4 invocations of the address validation page, not 3 as was recorded.

The first is as I would expect, and has the new companyId in the querystring.

The final 3 are what was recorded, with the recorded value of the querystring parameter.

This surprises me...the tool appears to be forcing navigation through pages instead of letting it happen as a natural result of actions taken on pages and verifying that the recorded path is followed acurrately.

I also generated code from this test and ran it, with the same results.

kklasman at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
That is correct, by default the tool will execute the recorded URLs. That's what is recorded in the test, URLs (not, for example, mouse clicks).

Two areas in which the request is generated on the fly: redirects and dependent requests (the set of gifs, java script, css files that are downloaded as a result of the page being downloaded).

To get your test to work correctly, you will have to use an extraction rule on the request that has the newly generated company id, then bind the subsequent company id parameter values to the extracted value.

Ed.

EdGlas at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3

I've been trying to create the extraction rule, but cannot figure it out. What type is it? ExtractHttpHeader? Here's the contents of the Headers field on the Request pane in the web test editor for the url in question (edited for privacy purposes):

GET /.../RegisterValidate.aspx?CoId=3277903 HTTP/1.1
User-Agent : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Referer : http://mydomain.com/.../ComProfile.aspx
Host : mydomain.com
Cookie : state=23=207327&22=master&11=True&12=True; AXCOOKIELOGIN=%3Cmaster%3EdwMdX3uRZrEH185NnI2K6%2F; .ASPXAUTH=

You can see the CoId querystring argument, which is what I need to extract. But how?

I cannot find any useful documentation on this subject.

kklasman at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified