Hi
on 2.9
Sampler
+Assertion
+BeanShell Listener


Code in the listener

import org.apache.jmeter.assertions.AssertionResult;
AssertionResult[] results = sampleResult.getAssertionResults() ;
for(int i =0,j=1 ; i<results.length;i++) {
    AssertionResult result = results[i];
                             if(result.isFailure()  || result.isError()) {
        vars.put("assertionResult_" + j, result.getFailureMessage());
        j++;
                             }
}

regards
deepak


On Thu, Sep 12, 2013 at 8:08 AM, ZK <[email protected]> wrote:

> Hi,
> Is it possible to get "assertion failure message" and store it in a
> variable
> using beanshell?
> I am getting nowhere with this, I have tried but can't get it to work
>
> Is it possible using:
>
> http://jmeter.apache.org/api/org/apache/jmeter/assertions/AssertionResult.html
> <
> http://jmeter.apache.org/api/org/apache/jmeter/assertions/AssertionResult.html
> >
>
> Does anyone know the correct syntax for getFailureMessage()   ?
>
> TIA
> ZK
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Is-it-possible-to-get-assertion-failure-message-and-store-it-in-a-variable-tp5718151.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to