How to verify only certain text that present after filtering

I want to verify text after filtering and I want to filter only “testing” name that can be present. Frequently, I just use WebUI.verifyTextPresent(“testing”, false) to ensure that testing present but I also want to ensure that there are not text that present except that

1 Like

Perhaps the below might work. It tests if the word “testing” is present and then compares that to a RegEx expression for any text to be present as a text based comparison.

WebUI.verifyMatch(WebUI.verifyTextPresent("testing", false), WebUI.verifyTextPresent(".*", true), false)

You will have to test the above because I don’t have any environment that only has a single word.

Try WebUI.verifyTextNotPresent keyword.

https://api-docs.katalon.com/com/kms/katalon/core/webui/keyword/builtin/VerifyTextNotPresentKeyword.html

1 Like

Actually i know about this solution but i don’t want to make it hard code but it’s okay, thank you!