Reputation: 682
I have come from PostMan now using JMeter for stress testing, I have a POST method that works great with PostMan yet I can't seem to get the bearer token authenticating to work on JMeter. I have the same token in PostMan as JMeter (See Screenshots)
Any help or advice is appreciated. See screenshots:
Upvotes: 1
Views: 9131
Reputation: 168072
If you're capable of running your request successfully using Postman - you should be able to record it using JMeter's HTTP(S) Test Script Recorder
Start JMeter's HTTP(S) Test Script Recorder
Run your request/test in Postman
JMeter should capture the request and generate corresponding HTTP Request sampler and the HTTP Header Manager
More information: How to Convert Your Postman API Tests to JMeter for Scaling
With regards to your setup: the header name should be Authorization
and the header value should start with Bearer
followed by your token value
The main problem is that JMeter cannot reach the application on your local machine so make sure that the corresponding web server is started.
Upvotes: 1
Reputation: 3541
For using Bearer token, you should create HTTP Header Manager, what you have already added. Then add Key/Name what is used in request, mostly it's Authorization, but we should check it out. Please, provide Headers and Authorization tabs from postman. Then, add Bearer token to Value field.
In my case I should provide one more key/value: Cookie.
Upvotes: 3