无法通过使用示例变量将请求和响应值捕获到csv中 [英] Unable to capture request and response values into csv by using sample variables

查看:148
本文介绍了无法通过使用示例变量将请求和响应值捕获到csv中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我我在哪里做错了.

Could some one please advise me where am i doing wrong.

当我尝试通过将下一行添加到user.properties文件中来使用示例变量将请求和响应值捕获到csv中时:sample_variables = request,response

When i tried to capture request and response values into csv using sample variables by adding in the next line to user.properties file: sample_variables=request,response

它在csv文件的request和response列中抛出空值.

it's throwing null in the request and response columns in the csv file.

还有其他解决方法可以实现这一目标吗?

Is there is any another work around to achieve this?

谢谢, 拉贾尼

推荐答案

请按照以下步骤捕获请求URL和响应.或者,您可以使用Bean Shell采样器提取请求/响应.

Please follow the below steps to capture the request URL and response. Alternatively, you can extract the request/response using Bean Shell sampler.

  1. 打开 JMeter.Properties 并配置示例变量.重新启动JMeter.
  1. Open JMeter.Properties and configure the sample variables. Restart JMeter.

  1. 在测试计划中,为您的HTTP请求创建两个正则表达式提取器,一种是捕获"请求",另一种是捕获"响应" ".使用(?s)(^.*)正则表达式提取所有内容.
  1. In your test plan, create two Regular Expression Extractors for your HTTP request, one is to capture 'request' and another is to capture the 'response'. Use (?s)(^.*) regular expression to extract everything.

要捕获请求,请按如下所示进行配置.如果要捕获请求标头,请选择请求标头单选按钮.

To capture the request, configure as shown below. If you want to capture the request headers, select Request Headers radio button.

要捕获响应,请按如下所示进行配置.

To capture the response, configure as shown below.

  1. 汇总报告中,确保您选中了如下所示的选项,并在文件名"中提供了一个名称,例如google.csv.
  1. In the Aggregate report, make sure you checked the options as shown below and provide a name in Filename e.g. google.csv.

  1. 这是我针对Google.com的JMeter测试计划

  1. 这是预期的输出.签入JMETER_HOME \ bin \ google.csv.

这篇关于无法通过使用示例变量将请求和响应值捕获到csv中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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