Matt
Matt

Reputation: 1043

Karate - What is the easiest way to search the entire response for a string

I simply want to search the entire response for a string.

The code I am currently using is as follows:

And string responseString = response
Then match responseString contains "mySearchString"

Is there a way of doing this without having to convert the response to a String so I can do this in 1 line of code instead of 2?

Upvotes: 2

Views: 4048

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

Here you go:

Then match karate.toString(response) contains "mySearchString"

Upvotes: 3

Related Questions