Forum Discussion

mmoser18's avatar
mmoser18
Frequent Contributor
8 years ago

Contains assertion with option "Use Token as regular expression" not working?!?

I am trying to do a contains assertion that checks, whether a certain snippet is contained in the response.

 

I append a typical response as file below.

The responses of our web service are supposed to contain one or more snippets that look like:

            <OnBoardEquipment>
               <InflightEntertainment>true</InflightEntertainment>
               <FlyNet>true</FlyNet>
            </OnBoardEquipment>

If I copy the above snippet into a "Contains"-assertion the response matches.

But if I activate the "Use Token as regular expression" it does not, even though the entire text does not contain any special regex character that one would need to quote.

 

Trying to debug this I boiled this down more and more and I had to learn that even if I reduce the regular expression down to something ridiculous short like just 'On' or 'B' (both without the quotes of course) this does not match, even though 'On' or B' are of course contained in the response: OnBoardEquipment or OnBoardEquipment.

 

So, there must either be something broken in this Contains-assertions or then I haven't understood how one needs to specify that "token" that is supposed to match. Can you please elaborate or verify that this is broken?

 

Regards,

Michael

No RepliesBe the first to reply