Adding an IE7 Browser Template for use by Web Tests
This post walks you through the process of adding a new IE7 browser template that can be used by your web tests when running them stand alone or inside of a load test. When you run a web test, the test will appear as if it is coming from one of the predefined browsers. By default, they will simulate IE6. But this can be changed by opening the run configuration file, clicking on the web test tab and selecting a new browser type. When running a web test inside of a load test, you can add a mix of browser types that the web test will simulate. The way a web test simulates different browsers is by adding a set of headers to the request. The main header is the user-agent header which indicates the browser. Here are the steps for creating a new template: 1) Go to the location the templates are stored in: Program Files\Microsoft Visual Studio 8\Common7\IDE\Templates\LoadTest\Browsers 2) Copy the IE6.browser file and rename it IE7.browser 3) Open the IE7.browser file. 4) Change the name attribute on the Browser element to Internet Explorer 7.0 5) Change the value attribute for the User-Agent header to: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) 6) Save file Let’s verify the new template can be read in. 1) Close and re-open Visual Studio 2) Open a test project or create a new one 3) Add a web test to the test project 4) Open the LocalTestRun.testrunconfig file under the Solution Items folder 5) Click the web test tab 6) Click the drop down for Browser Type and select Internet Explorer 7.0 7) Save the test run configuration file 8) Run the web test 9) Click on any request once the test is complete 10) Click on the request tab in the web test playback UI 11) You should see the user agent header set to the value above.
You can also add this new template to a load test. When you are on the browser tab of the load test wizard, this new template will be one of the available browsers available. This same process can be used to add additional browser types that you want to simulate. |
Comments
Anonymous
December 15, 2006
Here is an article for adding an IE7 Brwoser template: Template ArticleAnonymous
January 17, 2007
Excellent it was really helpful Thanks SeanAnonymous
March 29, 2007
The comment has been removedAnonymous
April 03, 2007
At Geeks I showed the Load Test using IE6 as a client and mentioned that you can add your own entriesAnonymous
May 04, 2008
This blog post will describe how to create custom counter sets. First let me start with what a counterAnonymous
August 03, 2008
In Sean Lumley's Blog , it walks you through how to add a new browser to the Browser Mix in a Load Test