简体   繁体   English

JMeter-录制时无法登录到简单的身份验证网站

[英]JMeter - Trouble signing into a simple authentication website while recording

I have been trying to resolve this for some time now. 我已经尝试解决这个问题了一段时间了。 I tried googling for this problem but didn't manage to find anything. 我尝试使用Google搜索这个问题,但没有找到任何东西。 All the questions I found were about replaying already recorded HTTPS requests. 我发现的所有问题都与重放已记录的HTTPS请求有关。

So, I need to record HTTPS requests on a site protected with simple authentication (the pop-up window asking for username and password). 因此,我需要将HTTPS请求记录在受简单身份验证保护的站点上(要求用户名和密码的弹出窗口)。 And this is where I get stuck. 这就是我卡住的地方。 I enter correct login details and confirm it, nothing happens and in a second i get prompted to enter login details again, no error message nothing. 我输入正确的登录详细信息并确认,什么也没有发生,再过一秒钟我被提示再次输入登录详细信息,没有错误信息。 When I press ESC I get 401 UNAUTHORIZED error. 当我按ESC时,出现401 UNAUTHORIZED错误。

Basically the site is acting as if the login details were incorrect when in fact I tried the same login details without Jmeter's proxy and the server accepted it. 基本上,该站点的行为就好像登录详细信息不正确,而实际上我在没有Jmeter的代理服务器的情况下尝试了相同的登录详细信息,并且服务器接受了它。

What I tried: 我试过的

1) Logging into this site without JMeter's proxy - works without problem 1)在没有JMeter代理的情况下登录此站点-可以正常工作

2) Recording different HTTPS site with JMeter's proxy - I tried my email and that works correctly as well 2)使用JMeter的代理录制不同的HTTPS站点-我尝试了我的电子邮件,它也能正常工作

I should also mention that I am behind a company proxy, but I tried it at home and the result was same. 我还应该提到我在公司代理后面,但我在家中尝试过,结果是一样的。

As for JMeter configuration, I am using everything on default having: Thread Group HTTP Cache Manager HTTP Cookie Manager HTTP Request Defaults Recording Controller HTTP(S) Test Script Recorder 至于JMeter配置,我使用的是默认情况下的所有内容:线程组HTTP缓存管理器HTTP Cookie管理器HTTP请求默认值记录控制器HTTP(S)测试脚本记录器

Guessing the Thread Group doesn't really matter since I don't run any tests, only recording. 猜线程组并不重要,因为我不运行任何测试,仅进行记录。

Additional Details: 额外细节:

Server:IIS 服务器:IIS

Logging into sharepoint website 登录到Sharepoint网站

EDIT: 编辑:

Forgot to mention I tried already Blazemeter Extension, but when i try to record the logging session, it just freezes. 忘了提我已经尝试过Blazemeter Extension,但是当我尝试记录日志记录会话时,它只是冻结了。 Website hangs on trying to contact Blazemeter Cloud and Blazemeter plugin freezes, making it imposssible to stop recording and having to restart whole browser. 网站挂起尝试联系Blazemeter Cloud,Blazemeter插件冻结,无法停止记录并不得不重新启动整个浏览器。

Also just noticed that when I am already logged in and try to access the site it records it without any issue. 还只是注意到,当我已经登录并尝试访问该站点时,它会记录它,没有任何问题。 So it's only the login which is problematic for some reason. 因此,由于某种原因,只有登录有问题。

JMeter removes cookies and authorization headers while recording. JMeter会在记录时删除cookie和授权标头。

You can use JMeter Chrome Extension as an alternate way of recording your test scenario. 您可以使用JMeter Chrome扩展程序作为记录测试场景的另一种方法。

In order to properly replay the recorded script you'll need to add HTTP Authorization Manager to it . 为了正确回放录制的脚本,您需要向其添加HTTP Authorization Manager。

Sharepoint can have different authentication types, ie 共享点可以具有不同的身份验证类型,即

  • Basic HTTP Authentication 基本HTTP验证
  • Windows Integrated Authentication (NTLM) Windows集成身份验证(NTLM)
  • Kerberos Kerberos的

See Windows Authentication with Apache JMeter guide to learn how to bypass each authentication challenge in your JMeter test. 请参阅Windows身份验证与Apache JMeter指南,以了解如何绕过JMeter测试中的每个身份验证挑战。

So I was able to finally resolve this. 所以我终于能够解决这个问题。 The issue lied in sharepoint authentication. 该问题在于共享点身份验证。 I was logged in a domain with my personal account, but was trying to access the sharepoint using a different account. 我使用我的个人帐户登录了域,但是尝试使用其他帐户访问共享点。

Sharepoint ignored the login details I was prompted to enter and used mw domain credentials instead. Sharepoint忽略了提示我输入的登录详细信息,而是使用了mw域凭据。 So the answer for me was to access the sharepoint website while being logged into domain(windows) with the same account. 因此,对我来说,答案是访问共享点网站,同时使用同一帐户登录到域(windows)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM