Issue with containsString

Hi,

Why does the following code fails when the response doesn’t have the word “Hello”? I’m specifically saying don’t do anything if “Hello” is not present.

if (WS.containsString(response, “Hello”, false) == true)
{
System.out.println(“Yeah”)
}

Thanks in advance!

if (WS.containsString(response, "Hello", false, FailureHandling.OPTIONAL)) {
  println("Yeah")
}
1 Like