【发布时间】:2018-02-22 00:18:06
【问题描述】:
我对 JMeter 比较陌生,但我很难让 HTTP 采样器登陆安全网页。我认为它需要 NTLM 身份验证,因此我使用 HTTP 授权管理器来传递 BlazeMeter guide 中指定的凭据
我的授权管理器具有以下值:
- 基本网址:https://[测试站点]
- 用户名:[我的用户名]
- 密码:[我的密码]
- 域:与基本 URL 相同
- 机制:BASIC_DIGEST
但是,我只收到 401 错误(请参阅下面的采样器消息)
Thread Name: Thread Group 1-1
Sample Start: 2018-02-21 15:55:18 PST
Load time: 26
Connect Time: 0
Latency: 26
Size in bytes: 1602
Sent bytes:229
Headers size in bytes: 309
Body size in bytes: 1293
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 401
Response message: 401
Response headers:
HTTP/1.1 401 401
Content-Type: text/html
Content-Language: en
Server: Microsoft-IIS/7.5
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="BasicSecurityFilterProvider"
X-Powered-By: ASP.NET
Date: Wed, 21 Feb 2018 23:55:18 GMT
Connection: close
Content-Length: 1293
HTTPSampleResult fields:
ContentType: text/html
DataEncoding: iso-8859-1
我尝试了以下方法,但仍然收到 401 错误。有什么建议吗?
- 将所有 HTTP 请求实现更改为 HTTPClient4
- 在 user.properties 中设置 httpclient4.auth.preemptive=true
- 启用使用 KeepAlive 选项
【问题讨论】: