Jmeter test failed with only 5 thread - jmeter

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

Related

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.

Jmeter - incorrect sample time

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.

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

File is not got uploaded in case script run in Jmeter

I recorded a file uploading scenario and successfully saved in web application
now when i try to run recorded script by updating "send file with request" by some other file. there is no error seems in log but file is not getting upload in web application in case i run recorded script
Please Help!
enter image description here
First of all add View Results Tree listener and inspect "Request" and "Response Data" tabs. JMeter automatically considers requests with response code < 400 as successful so even if file upload didn't happen but browser responded with HTTP Code 200 (OK) - you won't see any errors or failed tests.
Usually ability to upload a file somewhere requires being authenticated (logged in). Try adding HTTP Cookie Manager to your test plan
Sometimes application under test uses dynamic parameters which are generated in runtime. So it won't be possible to record and successfully replay scenario. If you record the same request 2 times, inspect recorded requests and see the differences - it means you'll need to perform "correlation" - process of extracting dynamic parameters from previous response and adding them to next request. The most commonly used test element for this is Regular Expression Extractor.

Data entry through Jmeter not reflected in UI of application

I'm using Jmeter to perform load test on Moodle application
I followed the below steps to replicate a simple "add company " test scenario
1: Recorded the browser actions through HTTP Test script recorder and created a test plan with thread user of 1
2: Added HTTP Cache Manager,Added regular expression extractor for retrieving dynamically generated session for login HTTP request.
For Http request of adding new company, addded user parameters containing new company name
I run the test, everything seems ok in the view results tree- response section (response code: 200,response message:OK), all the required variables are passed in the HTTP POST
PROBLEM: New company added through Jmeter test is not reflected in UI of the moodle action
Can any of you please let me know
Is there something I could be missing or anyway I can debug the problem?
P.S: I'm new to Jmeter and looked around a lot for data inputted through Jmeter not being displayed in the UI of the web application,dint find useful results.
The answer to questions of this sort is almost always that you missed some necessary dynamic value besides session ID which you did catch.
An HTTP200 response just means the server returned a "good" response. Which could also happily contain an error message.
I would check the actual html body of the returned response for any errors. Checking the log on the server side can give you clues to what went wrong sometimes. You should also try adding a cookie manager.
Run your test with 1 virtual user in GUI mode with View Results Tree listener enabled and inspect responses to see where your scripts fails. My expectation is that you simply cannot log in.
See Moodle-JMeter-LoadTest.jmx file for reference, it uses XPath Extractor to get session key and course id.
I don't think you can test using JMeter. Try JUnit Test cases instead http://jakarta.apache.org/jmeter/usermanual/junitsampler_tutorial.pdf

Resources