0

The Project which I am working now require a performance test. So, I preferred JMeter for a load test and started learning one by one.

Now, When I recorded a test and included a CSV file for the dynamic parameter. I see the recorded pages has client id in many HTTP POST data pages. This application passes a JSON data for sending a request so in Body Parameter tab I see JSON type data.

So, added JSON Post Extractor for one HTTP request site passes alphanumeric value (5963948e2f123bd00a27d5cd). However, after I executing the test the page returns an error page.

POST http://192.168.1.10/api/editClient/getClientInfo/

POST data: {"clientId":"5963948e2f123bd00a27d5cd"} 

Response code: 400
Response message: Bad Request 
Response data: Failed to authenticate Token

can anyone help me on this?

3 Answers 3

1

Add a header manager - try with Content-Type and if it didnt work then try with Accept; remember these for the future - 400 series error - Check the Header file 500 series error - check the data

1

To get token values:: u need to pass parameters like username, password, grant_type, client_id n client_secret...which will be shared by respective developer of the API...

0

Most probably you need to add HTTP Header Manager and configure it to to send Content-Type header with the value of application/json

Another reason could be improper work of the JSON Extractor, double check the "token" variable value using Debug Sampler and View Results Tree listener combination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.