Beanshell Assertion
Beanshell Assertion
Could you help me with this Beanshell Assertion code:
I need to add 3 AND conditions & in the 3rd AND condition I need to add OR condition as well and I have tried the following code and I am getting the error
"BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String Response1 = prev.getResponseDataAsString(); String Response2 = prev.getRe . . . '' : Operator: '"||"' inappropriate for objects
"
Please click on the link to view the code I tried:
enter image description here
1 Answer
1
Your or condition should be between boolean expressions. So end your line with
&& (Response3.contains("Value4") || Response3.contains("Value5"))
Notice also that the convention for Java variables is starting with a lowerCase character as response3
response3
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Please post your code as text within your question. That way people can copy and paste it for testing.
– Chris
yesterday