Reputation: 4646
I want to create an https request to a server that requires username and password. Where can I provide the credentials? I couldn't find this option in the jmeter UI
Upvotes: 2
Views: 32546
Reputation: 2189
Get your credentials names using Developer tools -> Network tab -> Your POST Request -> Headers tab -> Form Data section.
Testing:
During Login Page passing jmeter gets a Cookie:
During a real request, jmeter uses the Cookie which have been set during Login Page passing:
Also, make sure you have CookieManager.save.cookies=true
in your jmeter user.properties
file. I've already done it earlier.
$ cat ~/.local/share/jmeter/bin/user.properties | grep Cookie
CookieManager.save.cookies=true
After file modification restart your jmeter.
Upvotes: 0
Reputation: 7489
To set up jmeter to access an https url:
Create an HTTP Request Defaults with your server name.
Set implementation to httpClient3.1 (it didnt work for me otherwise) Set protocol to https
Create an HTTP Request for the login
I used spring security, so I set path to /j_spring_security_check
Set method to post
In the parameters section, add the params you need to log in in the section called Send Parameters with the request. In my case I had to send a username and password param exactly as its defined in my login form.
Finally add a Response assertion to search for a text response. Here I checked for the full display name of the logged in person, since that shows up in the response.
If you want to save the cookie you might also want to create an HTTP Cookie Manager for the thread group
I followed this doc: http://jmeter.apache.org/usermanual/build-web-test-plan.html
Upvotes: 4
Reputation: 34516
It depends on authentication policy, if it's Basic Auth then it would be done through an Http Authorization Manager If it's form based, then passing them as parameters in Http Request will do it.
If you don't know your option is to record through browser and JMeter Proxy Server:
Upvotes: 0