JMETER错误:{“errorcode”:9999,“errormessage”:“位于0的JSON中出现意外的标记%”}

时间:2018-06-14 09:35:10

标签: debugging jmeter performance-testing remote-debugging

我正在运行测试并在共同关联sessionid之后运行它,我在“视图结果树监听器”的“响应数据”选项卡中收到以下错误。

你能帮我解决一下这个错误:

采样器结果:

Thread Name: Xaas_No 1-1
Sample Start: 2018-06-14 14:57:20 IST
Load time: 1731
Connect Time: 1255
Latency: 1730
Size in bytes: 852
Sent bytes:957
Headers size in bytes: 776
Body size in bytes: 76
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
x-powered-by: Express
content-type: application/json; charset=utf-8
content-length: 76
etag: W/"4c-gdbCiVcDg5gx+63/uawAq4eRIu0"
date: Thu, 14 Jun 2018 09:27:12 GMT
connection: close
Set-Cookie: BIGipServeriapxaasbotbuildertest.accenture.com-443=1932329994.47873.0000;Path=/;Version=1;Secure;Httponly
Content-Security-Policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' *.accenture.com; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' *.accenture.com data:; connect-src 'self' *.accenture.com *.dialogflow.com
Cache-Control: private; max-age=31536000
Strict-Transport-Security: max-age=31536000;includeSubDomains
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block


HTTPSampleResult fields:
ContentType: application/json; charset=utf-8
DataEncoding: utf-8

请求:

POST https://iapxaasbotbuildertest.accenture.com/channelService/channelWeb/619e81efe7

POST数据:

%7B%22entry%22%3A%5B%7B%22sessionid%22%3A%22%22%2C%22tenantid%22%3A%22619e81efe7%22%2C%22botid%22%3A%229bb95dfba0%22%2C%22channel%22%3A%22Web%22%2C%22messaging%22%3A%5B%7B%22message%22%3A%7B%22messageId%22%3A123%2C%22text%22%3A%22hi%22%2C%22timestamp%22%3A1528967999992%7D%2C%22sender%22%3A%7B%22id%22%3A%22USR12%22%2C%22name%22%3A%22sylvin%22%7D%7D%5D%7D%5D%7D=

[没有饼干]

Request Headers:
Connection: keep-alive
Origin: https://iapxaasbotbuildertest.accenture.com
Accept: application/json, text/plain, */*
Referer: https://iapxaasbotbuildertest.accenture.com/demo/webtest/?tenantID=619e81efe7&botID=9bb95dfba0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 managedpc (Accenture)
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 362
Host: iapxaasbotbuildertest.accenture.com

回复数据:

  

{“errorcode”:9999,“errormessage”:“JSON中出现意外的令牌%   在位置0“}

1 个答案:

答案 0 :(得分:0)

您不应该对JSON有效负载进行编码,它应该,因为它

因此,请务必在HTTP Request采样器中取消选中“编码”框

JMeter JSON Encode

还要确保将HTTP Cookie Manager添加到您的测试计划中,因为您似乎正在接收一些Cookie但不会将其发回。

如果需要,请参阅REST API Testing - How to Do it Right文章了解更多信息。