Katalon Recorder While Loop Wild Card

I have a While Loop which works great to check for values in a dynamic list. But that’s only if you know the exact value. The problem is there may be numbers or words before or after the value I am looking for - i.e. One of the values could be “1101 China Doll Pink.” I need to find any items with the phrase “China Doll” in it. How do I add a Wild Card before or after a value in this loop? I know to add an asterisk (*) if I’m looking to verifyText in a field for example, but the asterisks don’t seem to work here.

Here is my While Loop -

In KS, you have to precede the wild card asterisk with a period, so try that in KR. Like: .*

1 Like

Inside or outside the quotes? So is it ==.*“CHINA DOLL”? or is it ==".*CHINA DOLL"? And what about a wild card after the word or words? Something like “CHINA DOLL.*”? Or “CHINA DOLL”.*?

Inside. Like ".*CHINA DOLL" or "CHINA DOLL.*"

1 Like

Unfortunately, that did not work. The script went through without any errors, but it did not find “.*CHINA DOLL” as it should have.

The following suggests to use “include” instead of the wild card:

if statement - Katalon Recorder : If variable contains some text - True/False - Stack Overflow

1 Like

I did find out the .includes works, as long as I enclose the name in quotes AND parentheses. For example

“${color}”.includes(“CARDINAL”)

But now I’ve run into a new problem. I’ll post a separate question for that.