Web test support for random text extraction in SP1

In SP1 we added a new Random property on the Extract Text rule. This simple property enables some really powerful scenarios.

The best example is to randomly select a link that is the result of a query. This works nicely if search result urls are uniform and pass the selection as a query string parameter. For example, all search result links are of the form

 https://mysite/productdetails.aspx?productId=42

In the source page, this might look like:

 <A href="https://mysite/productdetails.aspx?productId=42">Telescope</A>
 <A href="https://mysite/productdetails.aspx?productId=43">Microscope</A>

What you can do with the new rules is randomly select one of the products on the search results page by extracting matches that start with productId= and ends with " to extract the 42 or 43, then set the random property to true to randomly select one of these products.

Another neat thing you can do is re-run the correlation tool after adding the extraction rule (Detect Dynamic Parameters command on the web test toolbar). Many times the value extracted (e.g. 42) is reused in other places in your script. The correlation tool will detect that, and make it easy to add the extraction rules and databinding to the right places in your test.

Ed.