Logical operations AND OR

Hi,

I wanted to use the logical operations AD and OR for making decisions. One of my scenarios is using AND operation for Assert operations .
My scenario is I want to check the response text contains 2 pieces of information:
1. Text like “Library”
2. Date value

For this I wold like to write
assert responseData.getResponseText().contains(‘Library- Ask a question’)

AND
assert responseData.getResponseText().contains(‘01/05/2018 2:21 PM’)

But this ends up being an script error. I could NOT find any reference on how to use Logical AND/OR operators.

Please help.

if you just put those two asserts without “AND”, you will get the same result with “AND” since each command will throw an exception if it failed.

Thanks Trong, but is it possible to use And/OR operators in the script?

prashant said:

Thanks Trong, but is it possible to use And/OR operators in the script?

http://docs.groovy-lang.org/next/html/documentation/core-operators.html i think answer for your question is already present on groovy docs

Hi Team,

Thanks for the response, please close this question