You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Erez Naim <er...@theneura.com> on 2015/04/21 10:29:17 UTC

Fail a sampler through beanshell Postprocessor

Hi,

 

I am using a beanshellprocessor and I am using Java code inside of it which
contain conditions I wonder how can I fail the sampler (but continue the
script) inside the beanshell sampler in case it won't pass the condition.

 

Br,

 


Erez Naim  |  QA Lead  |
<http://www.linkedin.com/profile/view?id=34323263>
<http://www.theneura.com/vCards/gilad.vcf>
<http://twitter.com/#!/giladmeiri/>   




EL AL 2 Street | Herzliya  
mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura

 


 <http://www.theneura.com/> website  |   <http://www.startupbitz.com/> blog
|   <https://twitter.com/intent/user?screen_name=theneura> twitter  |
<http://goo.gl/maps/ZRkg5> map    

 

 


RE: Fail a sampler through beanshell Postprocessor

Posted by Erez Naim <er...@theneura.com>.
ZK , 

It will mark the sampler as red? 

I have tried another solution that works just perfect:

Using beanshell: prev.setResponseCode("400") (or using any other error code
which will fail the sampler) that would mark the sampler as red.

Br,

Erez 

-----Original Message-----
From: ZK [mailto:stevesenior69@gmail.com] 
Sent: Tuesday, April 21, 2015 2:50 PM
To: jmeter-user@jakarta.apache.org
Subject: Re: Fail a sampler through beanshell Postprocessor

Hi,
using a 'beanshell assertion'

try:
Failure=true;
FailureMessage= "Test FAILED";
print(FailureMessage);


ZK



--
View this message in context:
http://jmeter.512774.n5.nabble.com/Fail-a-sampler-through-beanshell-Postproc
essor-tp5722290p5722292.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Fail a sampler through beanshell Postprocessor

Posted by ZK <st...@gmail.com>.
Hi,
using a 'beanshell assertion'

try:
Failure=true;
FailureMessage= "Test FAILED";
print(FailureMessage);


ZK



--
View this message in context: http://jmeter.512774.n5.nabble.com/Fail-a-sampler-through-beanshell-Postprocessor-tp5722290p5722292.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org