JMeter marks the request with response code 429 as failed in the Report and ResultsTree - jmeter

I am testing rate limiting features of an API.
And I have a JMeter HTTP sampler request, for which the anticipated and actual response code is HTTP 429, Too many requests.
But in the Results Tree and in the generated HTML report, this request's response is marked as failure, even though the actual response is 429 and the Response assertions is also for code 429.
Because of this my overall report is skewed with 100% failures, whereas actually everything has passed.
I need ideas on how to fix this Jmeter reporting issue.
Check the attached screencap of the Response in ResultsTree

Of course it does, all HTTP status codes above 399 and below 500 are so called "client errors", in general JMeter treats response status codes above 399 as errors.
If status code 409 is something you expect you can configure JMeter to expect it as well, it can be done using Response Assertion configured like:
More information: How to Use JMeter Assertions in Three Easy Steps

Related

performance testing using jmeter cross checking the response with web data does not match

I have a web service URL:
https://app.snapmed.no/landing-page?flow=chat
The response code is 200 and the response body does not contain any valid data to cross-check with the webpage response or data in chrome It is completely dynamic. Now I do not know a enter image description hereway to add response assertion for this type of response. can someone help me?
Actually you don't have to use assertions, as per Reducing resource requirements chapter of JMeter Best Practices
Use as few Assertions as possible
JMeter automatically checks HTTP Response status codes and marks the HTTP Request sampler as failed if response code is 400 or higher.
If you want to add an extra layer of check you can explicitly validate that the page returns the HTTP Status Code 200 as follows:
also as far as I can see the web page always contains Send bilder til hudlege text so you can validate it as well:
More information: How to Use JMeter Assertions in Three Easy Steps

My Jmeter script is passed even though code turned off on production

I have created scripts for smoke testing insurance quotes on jmeter.
Recently code has been turned off on production.
Now even though the code is off when I run my script my test gets passed.
Manually I am unable to perform the same steps in the production.
So what could be the issue with my script?
JMeter doesn't do any checks on the response body, it assumes that the request is successful if the HTTP Status code is below 400.
So if your HTTP Request samplers return HTTP Status code between 0 and 399 - it will be "green".
You can consider adding i.e. Response Assertion and configure it to check presence (or absence) of a specific text in the response body, this way you will be able to conditionally fail samplers if the expected text will not be present.
More information: How to Use JMeter Assertions in Three Easy Steps

HTTP 200 response code displayed as error in Blazemeter

I'm executing a jmeter script which has a response assertion as HTTP 200, the same works fine in local machine.But when executing the same in Blazemeter, it marks the HTTP 200 response as error and fails the sample with the error as "Response was null", thus increasing the overall error %.
Note: Even the "Retrieve All Embedded Resources" are unchecked in the script.
Any help is appreciated!
Reach out to BlazeMeter Support
Show your Response Assertion configuration (most likely they will ask for it)
Show your response data (can be partial) or JMeter Variable you are performing assertion against.

JMeter 0% error but no data

I just test my application that insert some data to database on other machine. Until the last scenario of test, jmeter says 0% error. But when I check my database, no data there. Where should I check this thing??
You need to use response assertions in order to test the correctness of response. Add response assertions and run the tests. At times the response code may be 200 ok but the action may not have been performed. In such cases you use response assertions.
Also verify response of your request to check the correctness of your script.
You should be looking at request and reesponse details in the View Results Tree listener. Also if your test relies on/uses JMeter Variables or JMeter Properties - you should also consider Debug Sampler or Debug PostProcessor
JMeter automatically treats 2xx and 3xx HTTP Response Codes successful, but it doesn't check integrity of response so it is totally up to you. See How to debug your Apache JMeter script article for more detailed tips.

Ignoring errors in JMeter

I want JMeter ignore an error. That request error is expected and is part of our session initiation protocol. Can't find a way to hide that error from be displayed on stats etc.
In other words: One of my SOAP samplers return an error (401, authentication thing) and that is expected. That is request error, yes, but not an error to report really.
Is that possible in JMeter to hide such errors somehow and/or exclude them from the test result?
You can also add a Response Assertion bellow the request and check the "Ignore Status" flag.
Two options:
Reconfigure where you've placed your Listeners, so the request is effectively omitted from results.
Use a beanshell post processor to write a short beanshell script to change the status from "fail" to "pass" if the code is 401.
Thanks Adagios.
I was looking how to test authorization failure to restful web service. So, your solution really helped me.
I configured HTTP request and HTTP Authorization manager with wrong username. It is expected to fail. Then, I added Response Assertion with Text Response and Contains "HTTP ERROR 401". I also marked Ignore Status, so the failure (because of wrong username ) from HTTP Request is dropped. So, I'd see only failure from Response Assertion in Assertion Results.
I coudn't find a solution for this but if the result is always 401, why not omitting this sampler from the test?
You may exlude this sampler from the results manually.

Resources