Hi I have noticed the below issue in reporting of Katalon :
A test case is marked as failed in report generated in ‘Reports folder’ even when the failing step exception in thrown in try and caught in catch block successfully.
Steps to Replicate :
Create a object ‘ABC’ with a random locator.
Add below script in your test case :
try {
WebUI.click(findTestObject(‘ABC’)) //This will fail as locator is wrong
}catch(Exception ex) {
WebUI.delay(5)
}
Run this test case.It is passing which is expected since I have caught the exception using try catch.
Add this test case in a test suite.Run that test suite.
Note the logs,the test case is passing.
Go to reports folder.Locate the report generated.
Notice the same execution of the above test case is marked a failed with try step shown as a failure for reason.
I’ve added a ticket for this. In the meanwhile you should add Failure Handling value to that ‘Click’ keyword, so it should be this:
try {
WebUI.click(findTestObject(‘ABC’),FailureHandling.OPTIONAL) //This will fail as locator is wrong
}catch(Exception ex) {
WebUI.delay(5)
}
This will mark ‘Click’ step as a Warning status in case the actual result of this step is FAILED, so that both generated report and Log Viewer will have the same statuses.
Ah I see. It will be fixed in our next release . By the way, this is just an issue with showing the incorrect result in ‘Log Viewer’. Actually the correct status is FAILED and it is correctly displayed in HTML report, so you can use that HTML report
So,as a workaround till the new release ,we can use ‘Optional’ failure handling in a test step, to mark it as a warning in case of it’s failure and mark the test case as pass.I am right with this ?
In brief,I want to pass the test case in case a test step fails.
My test steps are present within a try catch block. When i generate the test suite report, the PDF report does not provide detailed steps inside the try catch block. It only mentions that the try /catch block is executed and passed. Are we not specifying step details inside PDF report