How to add an Or condition to a statement

I want the request to pass in both cases, if the response contains "Completed" or "Progress", it will take time to process. "

But if I include both of these statements in response to the statement, he will accept it as an β€œand.” It will pass only if both are completed. One of them is enough here. Please suggest.

+4
source share
2 answers

You will need to find a statement that supports scripts, i.e. Bobahhel statement

  • Add a Beanshell Assertion as a child of the request that returns Completed or Progress messages
  • Put the following code in the "Script" area:

    String response = new String(ResponseData);
    
    Failure = !(response.contains("Completed") || response.contains("Progress, Will take time to process"));
    

    Where:

    • ResponseData - ,
    • Failure - boolean, , .

. BeanShell: JMeter Favorite Built-in Component , JMeter Java API Beanshell JMeter .

+5

Jmeter 3.2 Or

Response Assertion now allows to work on Request Header, provides a "OR" combination 

+1

All Articles