I would expect that each call to sample() in your line: SampleResult result = ctx.getCurrentSampler().sample(null);
would result in a new request being logged. If you don't want to use a Transaction Controller as suggested, the only way to "work around" this would be to write your own custom sampler that allows for retrying based on a text response from the server. Is there any more context for your question, e.g. why you might need to handle multiple failures before getting the response you want? On Sun, Nov 12, 2017 at 5:47 AM, Muhammad Nasir <[email protected]> wrote: > Thanks Antonio but I am not looking for this solution. > > *Muhammad Nasir* > Lead Quality Assurance Engineer > *folio3* Pvt. Ltd. > www.folio3.com > Cell: +92 332 257 9082 > > On Fri, Nov 10, 2017 at 7:05 PM, Antonio Gomes Rodrigues <[email protected] > > > wrote: > > > Hi, > > > > Use a Transaction Controller : > > http://jmeter.apache.org/usermanual/component_ > reference.html#Transaction_ > > Controller > > > > Antonio > > > > > > 2017-11-09 18:02 GMT+01:00 Muhammad Nasir <[email protected]>: > > > > > Anyone to help on this? > > > > > > -- > > > Nasir > > > > > > > On 09-Nov-2017, at 10:59 AM, Muhammad Nasir <[email protected]> > wrote: > > > > > > > > I am having false reporting due to number of retries. I have > > implemented > > > a retry mechanism as > > > > " ${__jexl3(("${Login_Code}" != "200") && ("${Login_Counter}" <= > > "2"))} " > > > > > > > > Let's say I am executing a request which retries for 2 times and then > > > Failed is actually reported as 3 independent requests on > > Aggregate/Results > > > Tree Reports. > > > > > > > > Is there a way to report this as single failure because this is > > > ultimately a single request with 2 retries? > > > > > > > > Note: I tried following solution and its not working either > > > > import org.apache.jmeter.samplers.SampleResult; > > > > > > > > if (new String(ResponseData).equals("message")) { > > > > SampleResult result = ctx.getCurrentSampler().sample(null); > > > > if (result.getResponseDataAsString().equals("message")) { > > > > Failure = true; > > > > } else { > > > > SampleResult.setSuccessful(true); > > > > } > > > > > > > > } > > > > > > > > Thanks, > > > > Nasir > > > > > >
