简体   繁体   中英

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. All the questions I found were about replaying already recorded HTTPS requests.

So, I need to record HTTPS requests on a site protected with simple authentication (the pop-up window asking for username and password). 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.

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.

What I tried:

1) Logging into this site without JMeter's proxy - works without problem

2) Recording different HTTPS site with JMeter's proxy - I tried my email and that works correctly as well

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

Guessing the Thread Group doesn't really matter since I don't run any tests, only recording.

Additional Details:

Server:IIS

Logging into sharepoint website

EDIT:

Forgot to mention I tried already Blazemeter Extension, but when i try to record the logging session, it just freezes. Website hangs on trying to contact Blazemeter Cloud and Blazemeter plugin freezes, making it imposssible to stop recording and having to restart whole browser.

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.

You can use JMeter Chrome Extension as an alternate way of recording your test scenario.

In order to properly replay the recorded script you'll need to add HTTP Authorization Manager to it .

Sharepoint can have different authentication types, ie

  • Basic HTTP Authentication
  • Windows Integrated Authentication (NTLM)
  • Kerberos

See Windows Authentication with Apache JMeter guide to learn how to bypass each authentication challenge in your JMeter test.

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. So the answer for me was to access the sharepoint website while being logged into domain(windows) with the same account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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