I am trying to learn the Jmeter and performing simple login test for a test website. but I am keep on getting following error,

Thread Name: Thread Group 1-1
Sample Start: 2019-09-05 18:56:28 NZST
Load time: 40
Connect Time: 0
Latency: 40
Size in bytes: 237
Sent bytes:757
Headers size in bytes: 237
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): 
Response code: 401
Response message: Unauthorized

Response headers:

HTTP/1.1 401 Unauthorized
Date: Thu, 05 Sep 2019 06:56:28 GMT
Server: Kestrel
Content-Length: 0
Vary: Origin
WWW-Authenticate: Bearer
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://www.skillswap.pro

HTTPSampleResult fields:
DataEncoding: null

enter image description here

1 Answer 1


Don't have enough reputation to comment, but you could try to investigate by displaying the HTML of the response to see what you get. You can find this feature in the View Results tree component

enter image description here

Also, sometimes there are tokens or other variables that are shared or incremented between your pages. In such case, you have to store them in a variable and give it back at each HTTP request.

enter image description here

To retrieve a token for example, you can use a Regular expression extractor, just look how it looks in your html. Here for example, it was in an hidden input tag.

enter image description here

I hope this puts you on the track to find the solution !

  • Thank you. Your answer helps a lot.
    – Hinata
    Commented Sep 6, 2019 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.