JMeter - In My local UAT Server same URL request not hitting second time(Error - 500)? - jmeter

JMeter - Parameterization(using CSV data),
JMeter - In My local UAT Server same URL request not hitting second time(Error- 500)
In My local UAT Server same URL request is not hitting second time it's displaying a Response code like - 500.
I generate script by using blazemeter chrome addons V.1.5.184.
Kindly give any solution for this.

It is not possible to suggest anything without seeing request details, response message, response body, your CSV Data Set Config details and partial CSV file.
Most likely your parameterization doesn't work as expected, I would recommend comparing what's is being sent in 1st and 2nd request using View Results Tree listener and double check variables coming from CSV using Debug Sampler. See How to Debug your Apache JMeter Script article for more details on JMeter tests troubleshooting.

Related

Jmeter API testing using csv input as post request in localhost

I tried to run a POST method for API testing in JMeter, I have sent the parameters as needed in body using a csv file. It works with https url(domain url) but not working in localhost. In localhost, requested body is showing blank. Please help me to resolve this issue.
There should be no any difference between local and non-local URLs so most probably you made a configuration mistake somewhere. We cannot state where exactly without seeing the test plan so I would suggest:
Inspect request and response details using View Results Tree listener
Ensure that the variables originating from the CSV Data Set Config really exist and have their respective values by adding a Debug Sampler and seeing what variables are there.
Check jmeter.log file for any suspicious entries. If it doesn't say anything meaningful you can try increasing logging verbosity to DEBUG level.

How to send a HTTP request in JMeter which is having an environment in its url?

I want to send HTTP request to a particular URL in JMeter to do performance testing, but the URL is containing a environment name in its prefix ex: http://dev-www.abc.com/. while I'm running the particular script its failing because of the URL prefix.
How to achieve this?
If you are enter server name / IP as per screenshot below then it is wrong
Protocol and server name have to be given separately as below
If you already have setup URL like the screenshot above, please update the question with screenshot of failure message
Your question is not very clear, going forward consider adding:
output of the View Results Tree listener showing request and response tab, preferably both data and headers
jmeter.log file, preferably full, or at least any messages of WARN and above severity
A couple of "blind shot" answers:
If you're asking for a single configuration point which will be applied to all HTTP Request samplers - it's HTTP Request Defaults
If you're building your request URL dynamically and getting Illegal character found in host: '/' error - make sure to put the URL into "Path" field of the HTTP Request sampler:

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

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