VSTS 2010 Load Test Browser Definitions

The list of browsers included in the VSTS 2010 browser list has a decent selection but with the release of IE9 and other browsers it’s already getting out of date. Luckily we can add additional browsers by creating new .browser files in Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Templates\LoadTest\Browsers (Program Files (x86) on 64-bit systems).  The files are simple XML documents that include a name and a few header items such as user agent so there isn’t really anything scary in there.  For example, the definition for IE8 is as follows:

<Browser Name="Internet Explorer 8.0" MaxConnections="6">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>


We’ve recently started load testing some new functionality and wanted to add a few more browser definitions.  Since I haven’t seen many others on the Web I thought I’d share what we came up with. I’ll probably update this document again in the future should we need additional definitions. I have to admit that I just guessed on most of the encodings since I didn’t actually have the browsers handy for a few of these. If you have any you see anything that’s clearly incorrect or have additional browser definitions to add to the list please leave me a note in the comments. You can also visit http://andylangton.co.uk/online-tools/check-browser-headers to view the header information for the browser you’d like to define in your tests.

Note: After adding or modifying a .browser file you’ll need to restart Visual Studio to load the new definition(s).

Internet Explorer 9

<Browser Name="Internet Explorer 9.0" MaxConnections="6">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>

Internet Explorer 9 (Compatability)

<Browser Name="Internet Explorer 9.0 (Compatibility)" MaxConnections="6">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>

Chrome 11

<Browser Name="Chrome 11" MaxConnections="6">
  <Headers>    
    <Header Name="User-Agent" Value="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"/>
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="gzip" />
    <Header Name="Accept-Charset" Value="ISO-8859-1,*,utf-8" />
  </Headers>
</Browser>

Mobile Safari (iOS4)

<Browser Name="Mobile Safari (iOS4)">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP,deflate" />
  </Headers>
</Browser>

Mobile Safari (Android 2.3)

<Browser Name="Mobile Safari (Android 2.3)">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/5.0 (Linux; U; Android 2.3.3; en-us; ADR6300 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP,deflate" />
  </Headers>
</Browser>

Mobile Safari (BlackBerry 9800)

<Browser Name="Mobile Safari (BlackBerry 9800)">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-US) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.246 Mobile Safari/534.1+" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>

Internet Explorer Mobile (WP7)

<Browser Name="Internet Explorer Mobile (WP7)">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>

Firefox Mobile (Android)

<Browser Name="Firefox Mobile (Android)">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/5.0 (Android; Linux armv7l; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP,deflate" />
  </Headers>
</Browser>
About these ads

About Dave Fancher

Dave Fancher is a Software Engineer at Performance Assessment Network in Carmel, Indiana, a Microsoft MVP for Visual F#, and author of The Book of F# from No Starch Press. He has been building software with the .NET Framework since version 1.1. Dave is active within the Indiana software development community as a member of IndySA, a speaker at user groups throughout the state, and a two-time contributor to Indy GiveCamp. When not writing code he enjoys spending time with his family, watching movies, photography, and gaming on on his Xbox One.

Posted on May 18, 2011, in Software Development, Visual Studio 2010 and tagged , , , . Bookmark the permalink. 8 Comments.

  1. Hi Dave,

    I am fascinated in what you are doing with Visual Studio to get the most out of it. Do you mind if I ask you a question about browsers. As I understand, a Web browser type is randomly associated with a virtual user, based on the browser mix. Are these setting simulated? Do we need to have separate machines ( agents ) to do load for a mix of different browsers? How it really works?
    Could you please explain?
    Thank you very much in advance,
    Elena

    • Thanks for your feedback, Elena. I’m glad you found this useful.

      You’re correct that browsers are randomly assigned to a virtual user based on the browser mix. The way the the browser mix works is that when VSTS makes an HTTP request (as defined by the Web performance test) it injects the headers defined in the browser definition file to simulate a request from that browser. Generally speaking the test process is the same regardless of which browser is selected so there’s no need to divide the test across machines for that reason alone. I’d point you to the MSDN article about specifying browsers in performance tests but it really doesn’t say much beyond what we’ve already covered.

      The real issue with performance tests comes from distributed environments and the number of virtual users you want to include in your tests. When you want to test more than 250 users or involve remote machines you need to look at the Visual Studio 2010 Feature Packs.

      Did this answer your question?

  2. Muchas gracias

  3. Thank you very much,
    I’m searching for adding browsers ,This is use full for me
    and you are right the resources on vsts LoadTest are very few indeed .

    • I’m glad you found what you were looking for. If you create any definitions beyond what I’ve listed feel free to send them over and I’ll include them in the list.

  4. Hi Dave,
    Do we need to have the IE 9.0 in agents as well to execute load test? or is it sufficient if we have it in controller?
    TIA

    • Sorry for taking a few days to get back to you, I was tied up with a company event and amazingly hardly touched a computer last week.

      Due to licensing considerations I haven’t really done much with distributed load testing so I’m honestly not really certain. I tracked down Configuring Test Controllers and Test Agents for Load Testing on MSDN and it sounds like the definition is only required on the controller since the controller sends the test to each agent. I guess the only way to know for sure is to try it and see. If you do try, could you let me know what you’ve found so I can update the post?

  5. Everything is very open with a very clear clarification of the
    issues. It was really informative. Your site is
    useful. Thanks for sharing!

Follow

Get every new post delivered to your Inbox.

Join 738 other followers

%d bloggers like this: