Hi everyone, I’m really confused about how Katalon decides if a test passes or fails. I’m running a test to check if a form submits correctly. When I look at the Log Viewer at the end of the run, every single step has a green checkmark and the final status is PASSED.
But when I open the Screenshots folder to see what happened, the final screenshot shows a big red “Invalid Data” error message on the website! If the error message appeared, why didn’t the test fail?
Here is the code I’m using for that part:
WebUI.setText(findTestObject('Object Repository/Input_Email'), 'wrong-email-format')
WebUI.click(findTestObject('Object Repository/Btn_Submit'))
// I thought this would check for success...
WebUI.verifyElementPresent(findTestObject('Object Repository/Success_Message'), 5, FailureHandling.OPTIONAL)
It seems like Katalon just ignores the fact that the “Success” message never showed up and the “Error” message did. How do I make the test actually fail when the UI shows an error?
After your click command, you might want to insert a “waitFor” command to ensure your desired message has time to be displayed. As an example, you could try something like below: