查看负载测试期间要求的参数 [英] Viewing which params were requested during load test

查看:89
本文介绍了查看负载测试期间要求的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio在线负载测试来测试具有来自CSV文件的可变参数的API.

I'm using Visual Studio Online Load Testing to test an API with variable parameters coming from a CSV file.

我的设置如下:

在属性中,我将显示单独的请求结果"设置为True,希望能够看到测试期间使用了哪些参数,但是我在报告中找不到任何内容?

In properties I set "Show Separate Request Results" to True, hoping that I would be able to see which parameters were used during the test, but I cannot find anything on this in the report?

这是这样做的方式还是我做错了什么?

Is this the way to do this or am I doing something wrong?

推荐答案

Visual Studio负载测试不能很好地显示各个测试用例的工作方式.测试用例日志显示测试使用的数据源值,请在日志的上下文部分中查看.默认情况下,将保留前200个失败的测试用例的日志.在运行设置中通过Maximum test logs进行了更改.通过更改运行设置中的Save log frequency for completed tests,也可以保留成功测试的日志.

Visual Studio load tests are not great at showing how individual test cases worked. The test case logs show the data source values used by a test, look in the context section of the log. By default, logs of the first 200 test cases that fail are retained; altered via Maximum test logs in run settings. Logs of successful tests can also be retained by altering Save log frequency for completed tests in run settings.

虽然日志文件的上下文部分中有数据,但是要打开每个日志文件,查看上下文,将右侧部分滚动到视图中,关闭日志文件是一件很费力的工作(例如,挥舞鼠标和单击鼠标).等

Whilst the log files have the data in their context sections, it is hard work (ie lots of mouse waving and mouse clicking) to open each log file, view the context, scroll the right section into view, close the log file, etc.

我用来记录数据源使用情况等的机制是使用具有PostWebTest方法的Web测试插件.每个测试用例完成时,它将有用的数据写入一个简单的文本文件.我为每个测试用例写一行,格式为CSV,以便可以在电子表格中轻松读取和分析.写入的数据包括日期,时间,测试结果,一些数据源值以及在运行期间提取或生成的一些上下文参数值.使用多个代理运行的测试将在每个代理上写入一个文件.收集这些文件将是一项小工作,但比查看单个测试用例日志文件要少.不幸的是,我还没有找到从使用Visual Studio Team Services(以前称为Visual Studio Online)运行的负载测试中收集这些文件的方法.

The mechanism I use to record data source usage etc is to have a web test plugin with a PostWebTest method. It writes useful data to a simple text file as each test case finishes. I write one line per test case, formatted as a CSV so it can easily be read and analysed in a spreadsheet. The data written includes date, time, test outcome, some data source values, and some context parameter values extracted or generated during the run. Tests run with multiple agents will get one file written on each agent. Gathering these files will be a little work but less than viewing individual test case log files. Unfortunately I have not found a way of collecting these files from load tests run with Visual Studio Team Services (previously known as Visual Studio Online).

可以找到我写的插件的早期版本此处.

An early version of the plugins I wrote can be found here.

这篇关于查看负载测试期间要求的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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