在vs 2012中使用数据源进行Web性能测试 [英] Web performance testing with datasource in vs 2012

查看:156
本文介绍了在vs 2012中使用数据源进行Web性能测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2012中创建的Web性能测试存在一些问题.我创建了一个测试以通过我们的订单系统,但是在该测试的第一次运行中,该页面上的错误您选择订单.如果我再次运行相同的测试,它似乎可以工作.

I'm having some issues with my web performance test that I created in Visual Studio 2012. I've created a test to go through our order system, but on the first run of the test it has errors on the page where you select orders. If I run that same test again it seems to work.

由于我使用的是包含用户名和密码的数据源,因此我仅进行了一项性能测试,并且该测试针对数据源中的每个用户运行一次.当它运行时,它通过了第一个测试,但是每个其他用户都在该页面上导致错误,从而导致购物车为空.在测试中第一个用户之后,似乎没有为每个用户生成或传递POST变量,这似乎是一个问题.

Since I am using a data source containing usernames and passwords, I only have one performance test and it runs once for each user in the data source. When it runs it passes the first test, but each additional user causes errors on that page which results in an empty shopping cart. It seems like an issue with POST variables not being generated or passed for each user after the first in the test.

有人知道如何解决此问题,而不必专门为每个用户创建Web性能测试?将一个性能测试与数据源一起使用会更好.

Does anyone know how to fix this without having to create a web performance test specifically for each user? Using one performance test with a data source is so much nicer.

谢谢!

推荐答案

Web性能系统旨在允许以您想要的样式进行数据驱动的测试.您的网站可能具有Visual Studio未检测到的某些参数. Visual Studio内置的用于检测动态参数的机制很好,但并非万无一失.

The web performance system is intended to allow data driven tests in the style you want. Your web site probably has some parameters that Visual Studio has not detected. The mechanisms built in to Visual Studio for detecting dynamic parameters are good, but not infallible.

第一步.只需通读记录的测试(包括表单参数),以查找可能遗漏的内容.您可以通过经验了解它们是什么.

First step. Just read through the recorded test including form parameters looking for things that may have been missed. You learn what they are through experience.

另一步.记录同一测试的两个版本,并尽可能接近地执行相同的步骤. (但不必担心思考时间.)然后比较两个记录的测试.查找表单发布参数和其他不同的值,并考虑是否应从较早的响应中获取它们.查找值来自哪个响应,并编写适当的提取规则以创建上下文参数.

Another step. Record two versions of the same test, as closely as possible perform identical steps. (But do not worry about think times.) Then compare the two recorded tests. Look for form post parameters and other values that differ and consider whether they should be taken from earlier responses. Find which responses the values come from and write the appropriate extraction rules to create the context parameter.

还值得记录和比较两个预期使用的用户名和密码相同的测试.

It can also be worth recording and comparing two tests that are identical expect for user name and password used.

除了使用Visual Studio记录测试并比较文件外,还值得使用诸如Fiddler之类的程序进行记录.

As well as recording tests with Visual Studio and comparing the files, it can be worth recording with a program such as Fiddler.

我发现将" .webtest "文件与良好的文本比较程序进行比较有助于发现差异,然后在Visual Studio中进行编辑.如果您有信心并保留备份,则可以在" .webtest "文件中编辑XML.

I have found that comparing the ".webtest" files with a good text comparison program helps find the differences, then make the edits within Visual Studio. If you are confident and keep backups you might edit the XML in the ".webtest" files.

更新:有关比较 .webtest 文件的说明.查看 RecordedValue ="..." 字段的不同之处,但关联的参数字段不会被上下文变量替换.

Update: Note on comparing the .webtest files. Look at where the RecordedValue="..." fields differ but the associated parameter fields are not replaced by context variables.

这篇关于在vs 2012中使用数据源进行Web性能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆