Verifying multiple text present on a web page

Hi all, I need help with verifying multiple text present on a page without duplicating the WebUI.verifyTextPresent. Would like to pass the multiple text objects as a parameter and verify multiple text present on a web page. Any suggestions will be much appreciated.

@sabtester1 It sounds like a classroom exercise, because you will either have multiple verifyTextPresent or multiple calls to the verifying method.

You can try to get an element’s actual text and then use verifyMatch (which is what I use except for the text of error messages).

On second thought, are you going to be reading the Text from a spreadsheet. Then you just need the one verifyTextPresent along with a cell counter. This idea suffers from web page updates not being the same over time.

@grylion54 Thank you soo much for your response. I’m new to katalon but I found myself duplicating quite a lot as mentioned above. Below is what am doing which I thought there could be a better way instead of this duplicate verification for soo many objects on the page. Please forgive me for saying verifyTextPresent instead of WebUI.verifyElementVisible. Any advice would be much appreciated.

WebUI.verifyElementVisible(findTestObject(‘TestBox’), FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementVisible(findTestObject(‘Button’), FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementVisible(findTestObject(‘Button’), FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementVisible(findTestObject(‘Dropdown’), FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementVisible(findTestObject(‘Dropdown’), FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementVisible(findTestObject(‘Button’), FailureHandling.STOP_ON_FAILURE)

@sabtester1 I personally don’t find anything wrong with your setup. I often check if elements are present with expanding sections (or not present in collapsing sections), check if radio buttons are on, or off, by default, any text in place by default. I recently found a bug for a textbox that was supposed to appear only when the drop-down above was selected as Other. Whatever it takes, go for it.

You can always come back to any TestCase with improvements when you find a better method.

@grylion54 thank you very much for your response, will leave it as it is.