我想通过使用Jmeter的HTTP采样器来测试Rest服务。第一个采样器生成一个令牌,我使用这个令牌在另一个HTTP采样器“GetUserandPolicies”(Rest WS请求)的头管理器中使用RegEx和ForEach控制器进行授权。我可以在视图结果树中看到RegEx正在正常工作,将实际令牌传递给下一个请求。但是其他请求没有给出响应消息,作为禁止和响应代码403,这意味着服务器能够识别请求但拒绝访问。我猜这将是罪魁祸首,这个HTTP采样器没有端口号。但是,同样的测试是通过另一个工具(iTKO LISA),没有任何端口值。采样器“TokenGeneration”和“GetUserandPolicies”都没有端口值。我需要一些帮助。我使用的HTTP取样POST方法403通过Jmeter执行休息消息时的禁止消息
请找采样结果:
Thread Name: Thread Group 1-1
Sample Start: 2014-01-13 12:12:29 IST
Load time: 1390
Latency: 1390
Size in bytes: 382
Headers size in bytes: 354
Body size in bytes: 28
Sample Count: 1
Error Count: 1
Response code: 403
Response message: Forbidden
响应头:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization, X-Requested-With, Content-Type
Content-Type: text/plain;charset=UTF-8
Content-Length: 28
Date: Mon, 13 Jan 2014 06:42:30 GMT
HTTPSampleResult领域:
ContentType: text/plain;charset=UTF-8
DataEncoding: UTF-8
我可以建议你比较'iTKO LISA'和Jmeter采样器? – Stephan
行..会看到它,并得到回 – Narasimhan