Jmeter - incorrect sample time - jmeter

I have a scenario wherein i have to export the values(the details of a group of people) from a webpage either in CVS or PDF format in my desktop. The response was success When i recorded this scenario in jmeter. When i added recorded samplers in the thread group and ran them, i received success response with 302 response code. But the sample time is very less when compared with F12 time(manually captured it using F12 developer tool).
It was a POST request when i recorded it. In the results it was showing 3 different child samples out of that 1 is POST and the remaining 2 are GET requests. And 1 additional request with blank request.
The below is the structure:
1 /WebPages/Common/abc.aspx?mhsghgsjfgjsdg
-child1 (POST request)
-child2(GET request)
-child3(GET request)
1 /WebPages/Common/abc.aspx?mhsghgsjfgjsdg (blank request)
It's a C# application. Even for some other requests i am getting 302 response code with correct sample time. So i have no issues with those samples.
Could someone assist me to find out what could be the issue for the incorrect sample time? and how can i resolve it to get the correct sample time?
Appreciate your inputs or resolution.

Most probably you are not handling so called "embedded resources". Almost each HTML page contains some images, styles, scripts, fonts, etc.
In the "Advanced" tab of the HTTP Request Defaults configuration element tick:
Retrieve All Embedded Resources
Parallel Downloads
This way you will "tell" all JMeter HTTP Request samplers to download images, scripts, styles, etc. like browsers do therefore you should start getting comparable response time.
For more information on tuning JMeter so your test would be more realistic check out How to make JMeter behave more like a real browser guide.

Related

Omit the redirection responses on the html report results when running performance tests using JMeter

I'm running performance tests against a server, which uses a proxy that redirects (302) to the real backend service (api under test).
As result of that, when running the tests I get always two responses per requests (302 and 200) which is totally fine, but I wouldn't like it to be displayed in the html report that i generate using JMeter CLI:
jmeter -n -t Workbench_Performance_Test_Plan.jmx -l LoadTest/loadtest.csv -e -o LoadTest/HtmlReport -f
So these are displayed as get link by id-0 and get link by id-1
I've seen there is a way to filter by success or error in the View Results Tree or Table, but is there a way to omit those additional requests (302) using any kind of filtering without removing the errors?
Many thanks for your help.
I post my solution here in case anybody runs into the same issue.
In the Http Request Sampler there is a checkbox to force "Redirect Automatically" that has to be checked:
So in this way the published results (as well as the View Result tree output) will display only one row or item per request:

Jmeter test failed with only 5 thread

I am new into Jmeter and trying to do my first load test, When I get my data from website it is always come in .txt form and when this data I try to run my test it fails,
It's hard to say what is wrong without seeing the "Sampler result" tab screenshot for at least one failed sampler.
Going forward consider providing as much information as you can, i.e.:
Screenshot of the HTTP Request sampler
Screenshot of the View Results Tree listener demonstrating Sampler result, request data and headers and response data
At least relevant parts of the jmeter.log file, better with the debug logging for the test elements involved enabled

handling dynamic pop-up error message in jmeter

I have a Jmeter script for an application for which i get pop up error message intermittently. Where as in jmeter we only come to know that flow got terminated by some failure.But we wont come to know the occurrence of Error pop -up message.
My requirement is if we encounter pop up error i want to write to an external file saying that ,the current page got failed due to pop-up error message.
If we can write the error message it's really great. I'm as of now not getting idea to achieve this.
Please can anyone help me in this. or can provide any hint to do R&D.
Thankyou in advance.
Updated the question with screen shot of error message.
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
Looking into your screenshot, it is a form of JavaScript popup, most likely window.alert so there is no way to detect it via JMeter.
You can add i.e. Response Assertion to your test in order to introduce some pass/fail criteria, i.e. if you were in the middle of some transaction when the error occurred it should not finish successfully resulting in missing expected entry in the web page (or database), so you can conditionally fail relevant sampler(s) in this case. See How to Use JMeter Assertions in Three Easy Steps to learn more about the concept.
Alternatively you can use WebDriver Sampler plugin which provides JMeter integration with Selenium browser automation framework which drives a real browser, so you will be able to capture this popups and record the page titles/take screenshots, check out IsAlertPresent() class for more information.
you must get this error response in your jmeter request response.simple answer.Have a regex to extract.

F5 BIG IP - ajax POST with HTTP response truncated

Jmeter 2.12.
I used a scenario fully functional in front of a reverse proxy Apache. Recently we 've replaced the reverse proxy with the F5 BIGIP technology and now my scenario hangs.
The problem is for a particular ajax POST request the HTTP response is truncated : i receive a 200 OK but the HTML content is not full (no html tags for example). When i post the same request with Firefox the full content is ok.
Note that i don't receive the http header Transfer-Encoding: chunked.
In this case what can be the difference between Firefox and JMETER ?
Anyone have an idea on how could i get the full html response ?
Thanks for any reply.
That completely depends on the settings on your F5 and what exactly you mean with "response is truncated" and "no html tags". Do you get the correct response but the html tags are stripped out? or is the response just truncated so you i.e. only get the first n bytes?
The best way to find out what is actually going wrong is to use something like fiddler in between and try to find the real difference between the responses, especially regarding the response headers (Content-Length, Transfer-Encoding, etc).
When you found the actual difference please post here so we can help you further.
On a sidenote, by any chance do you have some custom coding on the f5 (iRules) which react to different user-agent settings?
Given you send identical requests you should be receiving identical responses.
Use JMeter's View Results Tree listener to inspect request details, or even better compare requests which are being sent by Firefox and JMeter using a lower level network sniffer tool like Wireshark, detect the differences and configure JMeter accordingly to send the same request(s) as Firefox does.
The other reason might be JMeter truncating large response, by default JMeter displays "only" first 10 megabytes in the View Results Tree listener, if this is the case - you can add the next line to user.properties file:
view.results.tree.max_size=0
and restart JMeter to pick the property up - it will suppress response truncation and you will be able to view the full response data.
Alternative way of setting the property is passing it via -J command line argument like:
jmeter -Jview.results.tree.max_size=0 ....
References:
Full list of command-line options
Apache JMeter Properties Customization Guide

Tips to confirm JMeter script is working when receiving no errors

I am running a JMeter script to hit a web page that opens another link to a shopping cart. There are a few different urls that JMeter recorded for me using the HTTP Script Recorder. When running the JMeter script, I receive no errors in any logs ( JMeter log and a few summary report / View results tree logs ). I even added a Constant Timer to some of the pages that do actually take a few seconds to load when hitting them manually in a web browser. In the end, I cannot see what is happening, but JMeter also does not indicate any errors. How can I confirm that each url hit is actually succeeding so that the shopping cart actually gives me my item when JMeter is done?
If JMeter is able to make a http request successfully, it will be always green in View Results Tree (200 http code). It does not mean that your test is correct - ie even if the login is not successful JMeter does not report it as error/failure unless you validate the response.
I think you need assertions to ensure that the http response you get is as you are expecting.

Resources