0
votes

I am trying to make a script to test REST services using Jmeter. Till now I was using Chrome’s Advanced REST Client. My authentication request was GET and it was something like this in Advanced REST: https://username:password@URL:portnumber its a GET request

Now when I am using Jmeter. I tried following ways: I added HTTP Authorization Manager and mentioned Base URL and Username/password inside it. When I am trying to do a request then its showing me “Unauthorized”

I also tried to login using normal https request but no success.

When accessed manually, a authorization popup window appears and username and password is submitted inside this window.

Please suggest me a way for how to login using Jmeter.

1

1 Answers

0
votes

Few suggestions:

  1. Most likely you have mismatch in URL you're trying hit and the one, specified in HTTP Authorization Manager, double check it.
  2. Add View Results Tree listener and make sure that the header like:

    Authorization: Basic xxxxxxxxxxxx=
    

    is being sent along with the request and compare it with the one, sent by the real browser.

  3. Try switching "Implementation" of your HTTP Request samplers to HttpClient3.1, the easiest way of doing this is using HTTP Request Defaults

  4. And finally, you can use HTTP Header Manager to send the relevant header, it's name should be Authorization and value Basic and username:password encoded in Base64. There is base64Encode function available via JMeter Plugins.