I´m testing a software and its architecture with jmeter, I'm using a webservice that inserts some values to a table and in the middle of the load I shutdown the database server (I'm using a sql cluster architecutre) then, the backup server starts to recive the threads....
There´s a period of dead time between shutting down the main server and the start of the backup server... in that period of time, jmeter says the request was succesfully completed (maybe because the app server is active) but that´s not true beacuse there´s no any database server active that can process the request...
If I check the "view results as tree" response I have this:
<errorCode>751</errorCode>
<errorMessage>Cannot open database "DBNAME" requested by the login. The login failed.
Login failed for user 'USER'.</errorMessage>
Why is jmeter saying the response was ok when there isn't a database active?
How can I filter the results so jmeter only counts the results that are ok? or how can I say to jmeter that when the response has that error message it should count as an error?
JMeter considers HTTP Status Codes below 400 as successful, the fact your application returns HTTP Status code 200 (OK) or whatever below 400 indicates its incorrect behavior.
If you are totally sure that your application acting as designed you might want to configure JMeter to check response body to ensure that it doesn't contain <errorCode> and/or <errorMessage> tags via Response Assertion.
Check out Response Assertions in JMeter 3.2 - New and Improved article for more information on assertions concept, learn how to conditionally fail JMeter samplers and what exact configuration is needed to get this done
Related
websocket request shown runs successfully on jmeter but in server shown error and Even in summery report report max time shown 0 for all requests. Could you please help to improve the jmx script. please refer attached jmx script and document.
Summery report
https://drive.google.com/file/d/1TbwatJR7AiiL09JU1RGl5BPQIj1sj8IG/view?usp=sharing
Could you please help to improve the jmx script - no, we're not supposed to do your job for you, if this is what you're looking for - consider freelancers services like Fiverr or Toptal however I can give you some idea regarding what could be wrong.
If connect time, latency and elapsed time are 0 then your requests are not very "successful", up to certain extent they are, but my expectation is that if you enable debug logging for WebSocket Samplers component you will see each Sampler returning 101 Switching Protocols and I believe this is not something you expect from your WebSocket Samplers.
Given you're capable of successfully executing your scenario in browser you can capture the requests which are being sent by JMeter and the real browser using a 3rd-party sniffer tool like Wireshark or Fiddler and compare them. The requests must be exactly the same (apart from dynamic values which need to be correlated), once you amend your JMeter configuration to send the same requests as browser does your test will start working.
Today i got issue Non Http Response code when run script on Jmeter. My script run over some steps (Login - view) but got this issue and have log that issue at NoHttpResponseException.
I'm using Jmeter version 3.3. And I think that maybe this issue from server side, not by my script.
Does anyone fix this issue before? Please support me to resolve it.
This status code is being returned when an Exception occurs during HTTP Request sampler execution. There are hundreds or thousands of possible exceptions and even more potential causes for them.
If it occurs only under the load - most probably it's a server side error and you need to check the application under test logs and monitoring software results to identify the cause
It might be something described in the Connection Reset since JMeter 2.10 ?
It might be the case your JMeter script is badly designed/implemented and you're sending garbage instead of proper HTTP request
So try to collect as much information as you can:
Application under test and JMeter logs (it includes any middleware such as reverse proxies, load balancers, databases, etc.)
Application under test and JMeter machines health metrics (CPU, RAM, Network, Disk, Swap)
Network layer information, i.e. HTTP Request and response details.
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.0 (or whatever is the current latest JMeter version available at Downloads page) as soon as it will be possible.
I am creating a script through Blazemeter (which storing some data in DB) and running through JMeter. Script is running fine but data is not stored in DB. What I am missing?
The chance of replaying recorded script is minimal as modern web applications widely use dynamic parameters for security reasons or client-side state tracking
Make sure to add HTTP Cookie Manager to your Test Plan
Make sure to perform correlation of any dynamic parameters
With regards to "Script is running fine" - JMeter automatically treats responses with HTTP Status Codes below 400 as successful, so "green" result doesn't necessarily mean that your script is doing what it is supposed to be doing. Try inspecting responses using View Results Tree listener, most probably you're getting stuck at login page. Going forward you can consider adding Response Assertions in order to perform extra checks against the responses.
Getting high Error% in jmeter after run, how to know this error is due to out of memory or used machine doesn't have capability or the http request has an issue. In my case getting Error% in jmeter summary report is 97.50% (for login api) and when loaded this result in 'View results tree' can see 500 internal server errors or the failed requests. Please suggest what measures can be taken to analyse these errors.
As per the RFC 2616
10.5 Server Error 5xx
Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has erred or is incapable of performing the request. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. User agents SHOULD display any included entity to the user. These response codes are applicable to any request method.
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
So the possible reasons are in:
You are sending incorrect requests which cannot be processed on your server side. Check server logs for details, most probably you will be able to figure out something from them. If you don't have access to logs you can at least configure JMeter to save response data for failed requests, add the following lines to user.properties file to trigger this on:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data.on_error=true
Check out Configuring JMeter chapter for more information.
It may be your application components configuration which is not suitable for high loads, i.e. your application server or database can be configured to accept not more than X connections and your load test is exceeding this value. The solution is again to check application, web server and database logs and make required configuration changes
It may be due to simple lack of resources, i.e. CPU or RAM on server side so you can monitor them using u.e. JMeter PerfMon Plugin. See How to Monitor Your Server Health & Performance During a JMeter Load Test for more details.
I created a jmeter script for an MSTR application. The server on which this application is hosted was shut down by the Development team but my script is still running successfully.
Why is the script not giving errors??
In case of HTTP Requests JMeter automatically treats all HTTP Status Codes which are less than 400 as successful.
You can consider adding i.e. Response Assertion to ensure that the test is doing what it needs to do and, expected information is present at the page, not expected information is not present, etc. You can also set maximum response time via Duration Assertion, check response for being HTML/XHTML/XML-compliant via HTML Assertion, etc.
See How to Use JMeter Assertions in Three Easy Steps guide for comprehensive information on conditionally failing JMeter samplers using assertions
You are getting an impression that the script is running successfully based on the response code you are receiving. For correctness of the tests, it is advised that you add response assertions to your scripts and add certain text as a pattern which is expected as result of successful response for respective request.
In this case you also need to make sure that you don't add response assertion for each and every request as it can make the JMeter script heavy to execute and JMeter may run out of memory if appropriate memory is not allocated.
Add a response assertion and re-run the test and make practice to use it to validate the correctness of your script.