1
votes

I am issuing a https POST request with valid credentials for a log in flow and it involves sending few parameters and request headers. I have compared POST data and Request Headers between Jmeter and Firefox (using Firebug) but I have not found any differences except for cookies not being sent through jmeter in Request headers as I have already included the Cookie manager in the test plan.

Login url(status code 302) from firefox redirects me to home page url(status code 200).Now the problem is that Jmeter script is redirecting me to same resource url as login page as if I am not sending valid credentials or request headers. I have searched a lot for root cause but can't seem to figure out what could be the problem. Any insights/suggestions is appreciated.

1
Can u provide sample of your jmeter script?Ronak Patel
Did you check "Follow Redirects" option in HTTP Request detailsKranthi Paidi

1 Answers

0
votes

except for cookies not being sent through jmeter in Request headers

That might explain everything. In order to send cookies you need to get cookies somewhere. Real user opens login page prior to typing credentials and clicking "login" or "submit" or whatever button.

Design your test plan as follows:

- Config Elements (HTTP Cookie Manager, HTTP Request Defaults, User Defined Variables, etc)
- HTTP Request (GET login page)
    - Post Processors and Assertions if needed
- HTTP Request (POST credentials)

See How To Use JMeter For Login Authentication article for comprehensive instructions.

A couple of "personal" recommendations:

  1. It's better to record your test scenario skeleton rather than creating it manually as errare humanum est. References:

  2. I don't trust neither JMeter nor Firebug hence using Wireshark to compare requests originating from the real browser and JMeter