zoukankan      html  css  js  c++  java
  • Adding an IE7 Browser Template for use by Web Tests

    Adding an IE7 Browser Template for use by Web Tests

    Sean Lumley's Blog

    Web/Load Testing

     

    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.

  • 相关阅读:
    VS2010中经常使用的快捷键
    IE无法打开internet网站已终止操作的解决的方法
    Spring3.0 AOP 具体解释
    Java 反射机制[Method反射]
    软件測试自学指南---从入门到精通
    Java中Map的使用
    tracert路由跟踪命令分析判断
    C++ Primer 学习笔记_32_STL实践与分析(6) --再谈string类型(下)
    ORACLE触发器具体解释
    Androidclient推断server是否开启 HttpHostException解决方式
  • 原文地址:https://www.cnblogs.com/liangqihui/p/597925.html
Copyright © 2011-2022 走看看