JMeter won't write response data - elasticsearch

I'm running tests with JMeter (master+10 slaves) on elasticasearch. I'm getting error 400 for some requests but they are a bit elusive:
When I run the requests manually with curl or pasting them on kibana's console, I don't get errors.
Every time I run the tests using jmeter, using the same requests and under the same conditions, I get a different number of errors.
So I was thinking of inspecting the response bodies from jmeter. But all the ways I've tried failed:
I've created a View Result Tree element and checked all boxes on the "configure" panel. When I run the script, it logs everything except response data
I've tried a BeanShell post processor to write all responses on a file. But it apparently is being 'ignored' when I run the script
Both these solutions work on my machine, but not on the server (which I don't have total control over). I'm passing jmeter.save.saveservice.response_data=true on the command line to start jmeter.
What else could I try?

This is an optimization that JMeter makes for distributed testing related to the mode:
https://jmeter.apache.org/usermanual/properties_reference.html#remote_batching_config
To avoid JMeter stripping the response data set in user.properties of servers snd controller:
mode=Batch
As by default it is:
mode=StrippedBatch

By default JMeter slaves don't send response data to the master, you can choose a different sample sender if you need more data.
Writing response data into a file using Beanshell should work in any case (however consider using JSR223 Test Elements and Groovy for this), just make sure that:
your Beanshell PostProcessor is placed correctly according to JMeter Scoping Rules
there are no Beanshell-related messages in jmeter.log files
you will need to collect the log files from each slave manually after test run, they will not be generated on the master

Related

Saving the jmeter result .jtl files in the Slaves machine

I have configured Jmeter distributed testing, and I'm successfully able to trigger the test from Master to Slave machine. But the results files are not being generated on Slave machine even if I explicitly added a Listener into the test plan.
Can anybody help on this.
Thanks in advance
Question answered in JMeter group by #glinius:
in user.properties, add: mode=StrippedBatch
This will:
remove some data from the SampleResults as the response body, but do you need response body during a High Load Test, NO, DEFINITELY NO !
will send Sample Results as Batches and not for every sample reducing CPU, IO and network roundtrips
Adding the listener itself is not sufficient, you need to specify the location for the .jtl file in the listener, i.e. Simple Data Writer is a good choice
The user which is running the JMeter slave process must have write permissions to the folder specified. See How to Save Response Data in JMeter article for more details if needed. If you want to save the response data - make sure to provide mode=Standard property
Also make sure to provide the valid resultcollector.action_if_file_exists property, i.e. APPEND if you want to add new results to the existing file or DELETE if you want to overwrite the old results with the new ones.
The property can be passed via -G command-line argument from the master or via -J command-line argument from the slave. More information: Full list of command-line options

JMeter Beanshell listner script sometimes get ignore in non-GUI mode

I created JMeter Test and under first "HTTP Request" I created a Beanshell listner script which works fine when using GUI but 8 out of 10 times the script totally get ignored in non-GUI mode.
I am also running these test in Gitlab CI using Docker Image "justb4/jmeter:latest" and Beanshell script also get ignored there. I don't know whats wrong there it is working fine with GUI
There is no such thing as "get ignored" in JMeter world, it either passes or fails, in case of failure you should see the relevant message(s) in the jmeter.log file
Also be aware that you should not be using Beanshell at all, starting from JMeter 3.1 you should be using JSR223 Listener and Groovy language for scripting, one of Beanshell's disadvantages is that it's being interpreted each time while Groovy scripts can be compiled and cached providing the most optimal performance. See Apache Groovy - Why and How You Should Use It article for more details.
Also be informed that we cannot efficiently help without seeing your code and the aforementioned jmeter.log file.

Jmeter reports - How can I create a report that will list all samplers, in the order they ran, with success or fail results

We are using Jmeter for non-regression testing. We want a report with all samplers listed, in the order they ran, and with succes or fail. If fail, we want it to list the reason (which asserts failed and why).
This is the behavior we were getting with old Jmeter using a view result tree outputting to a xml file, and then using the XSL Jmeter transform to create a html report.
In the new report framework, I have not been able to find a way to reproduce this. All types of reports seems to do aggregations.
This is something which is available in JMeter out of the box for quite a while.
Given the following test structure and the results in the View Results Tree listener:
Given you run your JMeter test in command-line non-GUI mode like:
jmeter -n -t test.jmx -l result.csv
Once test finishes you can open the result.csv file using LibreOffice Calc or Microsoft Excel or equivalent and you will be able to see all the requests in the order in which they were executed with success status, assertion failure message (if present) and other JMeter metrics
You can control which metrics to store in the .jtl results file by amending properties responsible for the Results file configuration

Is it possible to reuse created jmeter test plan for another test environment?

I have recorded a jmeter script for wiki page. That record was done in one of our test environment. That script is working fine and now i want to perform same load test for another test environment(Both environments are same, only urls are different).Is it possible to reuse?How can i do it?
I have added HTTP Request default element at the begging of test plan creation. Now recorded script consist of many HTTP Request element. Each request element contains Server IP of test instance.
Extract IPs and other env-specific data to .properties file:
http://jmeter.apache.org/usermanual/get-started.html#options
Read them in your JMeter with JMeter built-in function ${__P(someName)} as you see fit
Run your generic JMeter test with env-specific config data in .properties file
Yes. It is possible to run the same test in multiple environments. It all depends on how you design your test plan.
This site has exact details you are looking for.
http://www.testautomationguru.com/jmeter-manage-test-plan/

Fetch response times in JMeter running remotely

Ok so I set up my JMeter to run remotely using one slave computer (possibly more to come), and it's working out for the most part EXCEPT that I can't fetch the response time over time-graphs function using the JMeter plugin. I'm still able to use the "PerfMon Metrics" tool to get the CPU/Memory values from the slave computer, so I don't understand how I'm not able to get the response time results.
Does anyone have any experience using that function?
I would check the master- slave configuration: be sure that
the same Jmeter release is used
same directory tree structure is used
Jmeter-plugins are installed on both systems
...
If you use a standard "Summary report" listener, and save data to a file in the master, then you can reload and analyse the data off line with any listener.
HTH

Resources