Jmeter transaction controller not failing if parent is if condition - jmeter

I have a script that needs to check if "last sample is ok" through all the children, for this I have a If controller that is checking that condition for all children, the children are 6 transaction controllers.
The problem comes when a request inside one of the transaction controllers fails, the if controller does his job and dont let the script flow but it also does not show any of the request inside the transaction controller that was send.
So I cannot see why or which sampler inside the transaction controller failed

Use "View Results Tree" listener to check which transaction is failing. This is helpful for debugging.
You will get an error if one of the request fail under transaction controller only when you uncheck "Generate parent sample" in transaction controller. If it is check then you will not see any thing in the view result.

Related

JMeter ignore specific types of responses in all Receive samplers (Websocket)

Is there a way for all Receive samplers to ignore specific responses in JMeter and wait for the one that we are interested?
To be more precise, we have created a jmx file that contains a large flow like a user would create on the browser. Each request sent is followed by a response, so we use a request handler followed by the corresponding receive handler for each call. And everything seems to work fine.
But there are cases that another kind of response may arrive, which is not the one we expect in our flow, but it is triggered by another independent mechanism. You can think of it like notifications sent to the user that is doing the flow and are independent of the flow itself, but theu are received in the channel (for us inside the websocket connection).
So we are trying to find a way to ignore a specific set of responses that may come while we are running the tests.
We firstly tried to add a While Controller in each receive sampler that checks if the content is of the desired type and if not loops again. But this solution has 3 disadvantages :
we have to add the sampler for the specific receive twice - one before the while element and one inside the element because we have to first extract the received data and while does not execute its contents before doing the while condition check
we have so many pairs of send-receive in our jmeter test script , that we have to add so many while controllers inside the script
since the received message may not be of the type we expect but another one that we want to ignore, then we cannot add a Response Assertion because it will fail if the notification arrives, so we have to verify the content indirect -> in the condition of the while loop
We use apache-jmeter-5.3.
So we are wondering if we could do another kind of configuration in order to avoid all these while loops.
It may be irrelevant to the solution, but we use websocket through "WebSocket Samplers by Peter Doornbosch".
Thanks
You don't have to, just amend your While Controller's condition to accept undefined variable as well
Sounds like a potential use case for using Module Controller to avoid code duplication
If you're getting the response you don't expect you can change the response body using JSR223 PostProcessor to the one you expect, example code
if (!prev.getResponseDataAsString().contains('foo')) {
prev.setResponseData('foo', 'UTF-8')
}

In Jmeter is there a listener that will just report the Transaction Controller Responses?

When I run tests and look at the aggregate report, I'm getting the Transaction Controllers as well as the actual calls within the controller.
Is there a way to get a listener/report that will just use the transaction controller response time?
summary report will provide transaction controller response times
Note : you have to select generate parent sample in translation controller
Make sure "Generate parent sample" is checked under "Transaction Controller" element.
You should see the expected result

JMeter Parallel Controller having two transaction controller issue

I have a Parallel controller and inside this I have 2 transaction controllers.
My one transaction controller passes but other one throws an assertion error.
But in response tree, both transaction controller shows as fail through all steps in the first controller is pass.
Is this due to parallel controller?
It's part of Parallel Controller limitations:
Parallel Controller does not support work with Transaction Controller so if used you can get an unexpected results. If you decide to use these controllers together familiarize yourself with already known problems that described in roadmap

JMeter - Requests not getting grouped within controllers in graph output

In my test plan I have a series of steps like Login, HomePage, DoSearch, DoTask, Logout and each has a number of HTTP requests. I have tried using Simple Controllers, Transaction Controllers, keeping transaction controllers within simple controllers, and vice versa but am unable to see the timings at a step level in any graph. It at the most shows me the timings for Login, but other requests are not grouped on either controllers. Tried checking "Generate Parent Sample" and "Include duration..." but no luck.
Can someone let me know what needs to be done here?
You need to add a Listener. Each listener provides different information. I usually just use aggregate report.

Newbie Spring Transaction question from controller

I'm using a spring REST controller & have a situation where both REST client call the controller to get values to be processed however I'm finding that they are both getting the same values to process when they both call the controller at the same time. I'm using JPA with hibernate as the provider.
I know that I need to scope the calls into separate transactions (which I have done by putting the #Transactional annotation on the controller method) but finding that they are still getting the same values.
Device 1 - Timestamp 0: Calls to Controller
Controller A: Reads from event queue all "pending" events
Controller A: Update "pending" events to "processed" events
Device 2 - Timestamp 0: Calls to Controller
Controller B: Reads from event queue all "pending" events
Controller B: Update "pending" events to "processed" events
Controller B should not the values that Controller A has picked up & Processed...
So what i expect that i'm looking for is a "read lock" across transactions.
I'm interested in scalability so want to adopt the best approach that help scalability (i.e. only want to hold the DB transaction for as short as possible)...
Thanks,
Controller B and Controller A, being started "at the same time", see the same events from the queue. Only after one of the controllers commits its transaction the queue is changed.
It is difficult to describe "the best approach" from such a short problem description. There are several possible ways to do it, for example, using the transactional messaging (JMS) or even doing "get the next pending event and mark it as locked" in a new transaction (but then you need a way to unlock it if the processing of the event fails).
I guess you will have to employ "some mechanism" that would tell your other controller about what events are already being processed. So that would mean having a mechanism which would lock the events until they are being processed. Somthing like what was suggested earlier "get the next pending event and mark it as locked". unlock it if the transaction committed/rolledback with appropriate status.
Hope that helps.

Resources