drwill's bailiwick

General insights and product information by David R. Williamson, Senior Development Manager

Web Test Variables

A customer emailed me today with a follow up question.  The original question was about web tests recording AJAX-style client side scripting which initiates server queries.  In VS2005 we didn’t record those requests and our work around was to use Fiddler2 to record the scripts.

In VS2008 we fixed that which is great for customers because it’s much easier to record the web test file directly rather than having to switch to another tool.  No offense to the author of Fiddler2.  It is an amazing web debugger that one should have installed anyway.  I’m using it for debugging a for-fun app I’m writing on the weekends to download some special podcasts.

Anyway, the new question was when I parameterize the web server name, how do I change it to a temporary value for a one time execution?  This feature has been in since VS2005 and I tried it to make sure before I responded… but it didn’t work.

I looked up the topic on MSDN and it turns out you have to prefix the variable.  I asked one of our web test gurus and he said it’s always been that way, but I guess I forgot.

If your variable name is WebServer1, then at the command-line set the environment variable name to be Test.WebServer1.

e.g. C:> set Test.WebServer1=www.MyCustomServer.com

Here’s the direct link to the help topic: http://msdn2.microsoft.com/en-us/library/ms184806.aspx.