如何修复jmeter中的401未授权问题

如何修复jmeter中的401未授权问题,jmeter,Jmeter,响应标题: Thread Name: Thread Group 1-1 Sample Start: 2019-02-08 15:51:46 IST Load time: 1412 Connect Time: 525 Latency: 1412 Size in bytes: 1508 Sent bytes:603 Headers size in bytes: 843 Body size in bytes: 665 Sample Count: 1 Error Count: 1 Data type (

响应标题:

Thread Name: Thread Group 1-1
Sample Start: 2019-02-08 15:51:46 IST
Load time: 1412
Connect Time: 525
Latency: 1412
Size in bytes: 1508
Sent bytes:603
Headers size in bytes: 843
Body size in bytes: 665
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 401
Response message: Unauthorized

服务器以“401 Unauthorized”错误拒绝请求,因为您的应用需要授权。通常,身份验证请求返回此值。因此,您需要从答案中提取这个标记

  • 添加到您的测试计划中
  • 将身份验证请求添加到,并将其值发送到下一个请求(在该请求中出现错误)
  • 本指南还可以帮助您了解从第一个请求(登录)中提取会话id所需的文章。这个过程被称为

    可以使用提取会话ID参数,相关配置如下:


    向脚本中添加cookiemanager并在请求中进行身份验证。。
    HTTP/1.1 401 Unauthorized
    Public-Key-Pins-Report-Only: pin-sha256="9n0izTnSRF+W4W4JTq51avSXkWhQB8duS2bxVLfzXsY="; pin-sha256="5kJvNEMw0KjrCAu7eXY5HZdvyCS13BbA0VJG1RSP91w="; pin-sha256="njN4rRG+22dNXAi+yb8e3UMypgzPUPHlv4+foULwl1g="; max-age=86400; includeSubDomains; report-uri="https://a.forcesslreports.com/hpkp-report/00Dq0000000DFMbm";
    Expect-CT: max-age=0; report-uri="https://a.forcesslreports.com/Expect-CT-report/00Dq0000000DFMbm";
    X-Content-Type-Options: nosniff
    X-XSS-Protection: 1; mode=block
    Content-Security-Policy: upgrade-insecure-requests
    Referrer-Policy: origin-when-cross-origin
    Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
    Content-Type: text/html;charset=UTF-8
    Expires: Thu, 01 Jan 1970 00:00:00 GMT
    X-Powered-By: Salesforce.com ApexPages
    P3P: CP="CUR OTR STA"
    Transfer-Encoding: chunked