I'm using a MailReaderSampler which gets all the messages from given email ID. All the emails have a verification token in it. For now, the token is being passed on the subject of the mail.
So the Response Data will have:
Date:--
To: --
From: --
Subject: token : someToken
I have defined a Token value in User Defined Variables
and I'm using Response assertion
to check if the mail contains the Token.
So it checks for all the sub-results(all emails). Now whenever an email contains the token, then I want to stop the test and the assertion condition should not check in other emails as it already found the email which has token value.
Any suggestions on how to do it?
This should do the trick, but I haven't tried it yet... Add BeanShell sampler after your mail sampler with following code.