If else condition

Hello team,

I am using the ‘get text property’ in Katalon where I am comparing the numbers in one field to the other field. When I am using the ‘contains’ method in an if-else statement, it is showing me as follows:

How do I rectify this? Am I missing something?

Best Regards,
Saumil

It’s supposed to represent a deprecated method. However, try this:

sTransactionTableNumber.toString().contains("whatever")

Just makes me :roll_eyes:

I have seen others talk about this before, and I believe the general consensus is to not worry about it. The contains method is provably non-deprecated, and it works as expected.

1 Like

Thanks :slight_smile: this is working but is this going to be resolved antime in the near future?

Near future? No.

Far future? Doubtful. An upgrade to the IDE is on the cards. But seriously, this is NOT a problem. Follow the devs - move on and focus on something more meaningful. :sunglasses:

THis is pretty interesting. Groovy doc says that String version of the method is deprecated, but CharSequence (which is actually interface, that String implements) is fine. So the ultimately stupid way how to prevent deprecation is this:

sTransactionTableNumber.contains((CharSequence)"whatever")

But noone would ever do this. Weird…

Agreed. Much like my :roll_eyes: above.