I am writing a test that waits for a specific response using while controller. To be more precise, I send a message with jmeter, then that message gets state "sending" and after about 30 seconds it state changes to "received". So using while controller I try to get how much time that message needs to get received.
When I execute this test, it gets stuck after http request, which is executed in green and nothing happens next, what can be the problem here?
UPDATE ---------------------------------------------------------------------
Siunčiamas=Sending
Tried something different. Changed while controller value to -
${__javaScript("${State}" == "Siunčiamas",)}
and reg expression extractor value to -
class="label-primary label" id="parentSyncState">(Siunčiamas)<
and before while controller I'm giving State variable value "Siunčiamas"
Now it stucks on http request, but I added debug sampler after it, so it keeps repeating every 5 seconds. But it should be looping until regex extractor does not find required value and return default value which is not equal to "Siunčiamas" so while controller fails. Am I not getting something here?
It is not looping means, condition in While controller is not satisfied, not returning true
.
By the way, ${__javaScript("${State}".indexOf("Received") == -1,)}
means that, condition is true when State
does not contains Received
.
indexOf
returns -1
in case the string is not found in the parent (State)First time, it ran because, you set State
to not set yet
, where condition returns true
(indexOf returns -1 as "not set yet" does not contains "Received")
When I execute this test, it gets stuck after http request, which is executed in green and nothing happens next, what can be the problem here?
Does the test stopped or still running?
number of times http request has been sent* (http request response time + 5 seconds)
) the time required to get the "Received" message. Note: Add While Controller as a child to Transaction Controller to get the overall execution time.Add Debug Sampler to know what value is captured by State variable using Reg Ex Extractor.
Following is the screen shot that how i understood the scenario.
Share your Test Plan with us in order to help you.