3
votes

I have used login API to test in Jmeter.

For that I have passed request:

POST URL: .... POST data parameters: "email Address": "[email protected]","password": "ad332017"

For the above request i am getting two different responses.

On postman: I am getting response with status code 200 OK (which is expected too)

ON Jmeter I am getting response: Response code: 307 Response message: Temporary Redirect.

Anyone who can help me to solve this problem?

3

3 Answers

1
votes

Given you make the same requests (no matter which tool is being used) you should be getting the same responses so most probably there are differences in JMeter/Postman configuration. You can capture the requests sent by JMeter and Postman using a sniffer tool like Fiddler or Wireshark, figure out the differences and amend JMeter configuration to eliminate them

Also be aware that you can record your Postman request using JMeter's HTTP(S) Test Script Recorder, this way JMeter will capture the request sent by Postman and generate the releavant HTTP Request sampler along with HTTP Header Manager

  1. Configuring JMeter for recording is pretty easy, the fastest way is using JMeter Templates feature

    • From JMeter's main menu choose: File - Templates - Recording and click "Create"
    • Expand Workbench - HTTP(S) Test Script Recorder and click "Start"
  2. Launch Postman to use JMeter as a proxy

    %USERPROFILE%\AppData\Local\Postman\app-x.x.x\Postman.exe --proxy-server=localhost:8888
    
  3. Run your request in Postman

  4. JMeter should capture the request under the Recording Controller
0
votes

Most likely Postman is doing automatic redirection for you. JMeter is not.

You can toggle the automatically follow redirects setting by going to Settings -> General in Postman and see if it you are getting a different response.

You can open DevTools in the Postman App (View -> Show DevTools) and go to the network tab and observe the flow of requests.

0
votes

If you are using domain name n the post url, give the IP address instead of domain name.