如何在J-Meter 4.0中调试“响应代码500内部服务器错误”?

时间:2018-06-11 09:11:21

标签: jmeter performance-testing

我正在获取“响应代码500 - 内部服务器错误”,用于在Apache J-Meter 4.0中运行性能测试,以记录通过VPN完成的简单测试。我是这个工具的新手,想知道如何调查这个。作为参考,我提到了我得到的采样器结果错误。

Sampler Result:

Thread Name: Thread Group 1-1
Sample Start: 2018-06-11 13:21:56 IST
Load time: 1941
Connect Time: 1700
Latency: 1941
Size in bytes: 2301
Sent bytes:2145
Headers size in bytes: 594
Body size in bytes: 1707
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Internal Server Error

Response headers:
HTTP/1.1 500 Internal Server Error
Date: Mon, 11 Jun 2018 07:51:58 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 1707
Connection: keep-alive
Set-Cookie: AWSALB=ZS1nnfJyJ+Wk5NEu/FmWGmiRWfEQPnfiywAN8b8f8De6AjOYDrh0nWRVVcsQeBanayjPnpp1IxhjK34EipQB4m/lsAZgdKJ4mgUDDS+Yep8atzWucMNdYTw0oIdB; Expires=Mon, 18 Jun 2018 07:51:58 GMT; Path=/
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'self'
Vary: X-HTTP-Method-Override
X-Content-Type-Options: nosniff
X-Powered-By: Express


HTTPSampleResult fields:
ContentType: text/html; charset=utf-8
DataEncoding: utf-8

1 个答案:

答案 0 :(得分:0)

在大多数情况下,如果不进行修改,您将无法成功重播录制的场景。

  1. HTTP Cookie Manager添加到您的测试计划
  2. 检测所有动态参数并执行correlation
  3. 同时调查AWSALB Cookie,我的期望是您正在测试的应用程序"隐藏"在Amazon Elastic Load Balancer后面,请确保将DNS Cache Manager添加到您的测试计划中。
  4. 如果您仍然遇到问题,可以尝试使用WiresharkFiddler等嗅探工具捕获JMeter和真实浏览器发送的请求 - 请求应该 相同(除了第2点中提到的动态参数)。