my jmeter script is running inspite of the application server being shut down - jmeter

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.

Related

JMeter - returns 401 unauthorized for few test

I am using jmeter to load test a website. I have tested from 1 to 400 users. however while testing for above 500 users/threads, I am getting 401/unauthorized error for few users. Hope you'll help me to find out a solution to this problem.
I can think of 3 possible reasons:
There is a parameterization problem with your test, i.e. it sends wrong credentials, you can use i.e. Simple Data Writer configured to save requests and response data for failing requests and inspect it using View Results Tree listener.
JMeter gets overloaded and cannot properly perform correlation. In addition to point 1 check whether you're following JMeter Best Practices and ensure that JMeter has enough headroom to operate in terms of CPU, RAM, etc. using i.e. JMeter PerfMon Plugin
Your application gets overloaded and cannot handle 500+ users, check your application logs, resources usage, output of APM tools, etc.

Not able to add data for 50 users using Jmeter

Executed load testing script using JMeter for 50 users but it is not adding data in database for 50 users and adding only for 20 users, What is the issue?
Open your .jtl reusults file with a listener like Aggregate Report and check the number of failures, if it's around 40% - then you need to investigate the cause of the failures and see what needs to be done to fix them either from JMeter or from application under test perspectives.
If there are no failures in the .jtl file but your test is not doing what it is supposed to be doing - most probably it "silently" fails somewhere somehow. I would recommend adding Response Assertions to each and every step to validate that each response contains the anticipated data (or alternatively doesn't contain errors).
JMeter automatically treats HTTP status codes below 400 as successful and doesn't do any other checks so in case when an error occurs but application responds with a positive HTTP status code JMeter will consider the request as passed so you need to specify pass/fail criteria.
And last but not the least, you can temporarily amend the Results File Configuration so JMeter would store all the request/response details, after test run you will be able to examine the flows using View Results Tree listener and identify where and how exactly your script does fail.

JMeter test script is getting struck while running the script in GUI and Non GUI mode

JMeter test script is getting struck while running the script in GUI and Non-GUI mode.
I have recorded the script in our QA env and executed the script in JMeter it is working fine all scenarios.
But when I recorded the script in other performance test environment(Load balancing server with VM's enabled ) but in this Environment, I am not able to execute all scenarios, here in the middle of the scenario it is getting struck.
Please help here, how to proceed further.
your "getting struck" doesn't tell anything to us, you need to supply more troubleshooting information like:
.jtl results file
JMeter log file
Thread dump which can be taken from JMeter GUI or using jstack
For the time being I can give only a generic piece of advice: by default JMeter's HTTP Request samplers don't have any connect/response timeouts defined so it's up to underlying JVM and/or operating system when to close the connection so make sure to provide reasonable timeout values, the setting lives at "Advanced" tab of the HTTP Request sampler (or better use HTTP Request Defaults so the setting will be propagated to all HTTP Request samplers so you won't have to change it for each sampler individually)

Blazemeter Script Runninf on Jmeter doesnt save data in DB

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.

Jmeter & browser concurrent requests showing different results?

When I have given 500 concurrent users load via jmeter my server throwing error message but the same time I have called same request via browser showing proper response. How it is possible? Is there any settings in jmeter for avoiding same.
It is hard to say what can go wrong without seeing your JMeter configuration, full server response, JMeter and application under test logs and network dump for browser and JMeter.
The whole idea of performance testing is mimicking real user as close as possible, so you need at least
Add HTTP Request Defaults and set JMeter to:
Download embedded resources
Use concurrent pool of 2-5 threads
Add HTTP Cookie Manager
Add HTTP Cache Manager
Add HTTP Header Manager
Correlate any dynamic parameters
Simulate any specific application behaviour (i.e. AJAX calls)
etc.
In addition to above recommendations: ideally given "good" JMeter you shouldn't see any "response messages", you should see a number of errors in final report so double check you:
Run JMeter in non-GUI mode
Storing only those metrics which are absolutely required
Follow other recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure
beside, what Dmitri described above, I would also check the actual throughput the server returns in either cases.
Throughput depends a lot on the timers you configured in Jmeter to simulate think time.
Jmeter has no rendering and no javascript engine, so each thread is much much faster than a real browser.

Resources