JMeter: Transaction Controller label name is not displaying in aggregate report - jmeter

I have below JMeter scenario:
Inside a While controller, I placed If controller to check the last sample
success status (${JMeterThread.last_sample_ok}). WhileController runs for a specific time and then breaks the loop. My scenario is working fine but when I see the aggregate report I didn't see the Transaction controller name.
Jmx file
Aggregate Report

The Transaction Controller generates an additional sample when all the elements within the Transaction Controller are executed.
In your case, the nested elements were not executed yet. You will see the Transaction controller sample when all the elements within the transaction controller are executed.
It was not possible to reproduce the issue with similar configuration.

Related

How to get the parent sample generated by a Transaction Controller in JMeter? SampleResult.getParent() returns null

I have a Thread Group with a Transaction Controller with the "Generate parent sample" checkbox checked and underneath the Transaction Controller is a JSR223 Sampler in which I execute some dummy logging code just to exemplify the problem.
I want to ignore the parent sample and the child sample from all JMeter reporting at runtime.
If, in the JSR223 Sampler I do SampleResult.setIgnore(), then the sample generated by the JSR223 Sampler is no longer logged which is ok, but the Parent transaction generated by the Transaction Controller still gets logged with 0 values. This is observable in the View Results Tree listener.
If I try to get the parent sample, it is null so I can't interact with it in order to ignore it with .setIgnore().
log.info(SampleResult.getParent()) logs null in the log
and
SampleResult.getParent().setIgnore() throws error java.lang.NullPointerException: Cannot invoke method setIgnore() on null object
Is there any way to get and modify the parent sample generated by a Transaction Controller in JMeter?
I don't think it's possible, at least not with JMeter 5.5
I would recommend using Filter Results Tool to remove the "unwanted" transactions from the .jtl results file.
Filter Results Tool can be installed using JMeter Plugins Manager.
Alternatively, i.e. if you're generating a HTML Reporting Dashboard and don't want to include some Transaction Controller(s) into the report basing on a certain condition - you could rename the Transaction Controller and use jmeter.reportgenerator.exporter.html.series_filter and/or jmeter.reportgenerator.sample_filter properties to remove the "unwanted" results from the reporting scope.

How to also Ignore the Parent sample generated by the Transaction Controller along with it's children samples?

I am using JMeter 5.5 to put load on some webpages.
I have some webpage navigation flow recorded and I am using The Transaction Controller with the "Generate parent sample" checkbox checked to represent a webpage navigation (load). Underneath the Transaction Controller are the some HTTP Request samplers with "Retrieve All Embedded Resources" checked.
I want to ignore the first and last minute of script execution so I am using a JSR223 Postprocessor with code to conditionally ignore the samples based on the current time in the execution.
This works well if I don't use the Transaction controller, but when I use the prev.setIgnore() function and the sampler being ignored is underneath a Transaction controller with the "Generate parent sample" checkbox checked, then in the "View Results Tree" listener (and also in the JMeter Dashboard) I get an empty parent sample with Load time:0; Connect Time:0; Latency:0. This impacts my metrics in the final generated report.
Is there any way to ignore the Parent sample as well (remove it from the reporting) or can I achieve the goal in a different way?
Thanks in advance.
I think you need to replace prev.setIgnore() with prev.getParent().setIgnore()
In general ignoring samples with Groovy is not something I would recommend to do as it causes extra overhead, I would rather suggest using
either Filter Results Tool
or JMeter Plugins Command Line Tool
or use jmeter.reportgenerator.start_date and end_date properties in case of using HTML Reporting Dashboard

Group requests jmeter jtl result file

I have Test plan with a transaction controller Landingpage (containing 10+ requests). since I have clicked generate parent sample I get the complete result of the process (this is desired)
Now when I run Jmeterin non Gui and open the jtl file, dont get the result of landingpage but the result for every single request.
How can I run the test plan in non gui mode but still have the result grouped by transaction controllers
I cannot reproduce your issue using default Results File Configuration:
You should see each individual request under the "Landing Page" transaction controller plus 1 extra request with the name of your Transaction Controller and its response time will be the cumulative response time of all its children.
More information: What is JMeter’s Transaction Controller?

In jmeter how can i run transaction controller by putting multiple http request in it?

i need your help for transaction controller in jmeter.
I have a requirement to run 4 http request as one flow , so i have put them in one transaction controller , but once i run the script then all 4 requests runs individual and after that it runs in a transaction controller.
My expectation is that a script should run all 4 request in a transaction controller as one flow.
You don't seem to fully understand Transaction Controller concept.
It doesn't really get "executed", it is only a sum of its children elapsed times.
If you add i.e. View Results in Table listener you will see that:
Requests are being executed as "one flow", one by one
Transaction Controller response time is the sum of its children response times
Check out What is JMeter’s Transaction Controller? article for more details if needed
If I understood your requirement correctly, you can use below option to get your answer,
Select "Transaction controller" -> check on "Create Parent Sample"

Why jMeter show transaction controller data in its summary report?

Here i have A recording controller and test script recorder. I recorded the user activities using template. This automatically creates a Recording controller and then transaction controller. Each transaction controller has child HTTP request wrapped inside it. Now when I run the test after creating a test script, I see that the aggregated result shows information about (throuput, error, min etc) for child HTTP request(Sampler) as well as the parent transaction controller.
I'll make it more clearer with images below.
In the above picture ive created the test plan. Now when I run this test i get following result. The circled ones are the transaction controller.
Here, i have circled the parent transaction controller. Now why on earth is this adding up to the result.
Question: Is it making any request to the website? Why is this showing up and adding values to the child request. This thing is just a sum of all its child request - so, why is it adding up in the table?
Here again if I click on the "Generate parent sample" then it hides the child request and shows only the summed up report which is totally different from above report.
Now the question is how do I turn things around. What are the consequences. And what should I do in this case. Shall i compute the parent-child report or just the parent report data?
As per documentation of Transaction Controller:
The Transaction Controller generates an additional sample which measures the overall time taken to perform the nested test elements.
So if you don't want this additional sampler, just remove it or replace it by Simple Controller.
Note it is useful when it contains more than 1 sampler.
If you're looking to learn jmeter correctly, this book will help you.

Resources