You are dealing with two type of errors.
1) programming errors - which will fire when program con not run for any kind of error. eg "var x = 1/0"
2) testing error - Those are errors that you tester and TC thinks and error eg "Age of employee = 500 years"
employee_Age = 500
if (employee_Age>75){
Log.Error("he/she should be retired ")
}
still you can make script to interdependent those errors. eg if Age of employee>75 years then var x = 1/0
try catch will catch programming errors not TC errors.....
in your code first i fails
then you make it true ....so the loop run .........
even "ListViewObject.ClickItem(0,"COMPLETE");" fails it is a TC error not programming error
hence you have to raise an error for the code .. "ListViewObject.ClickItem(0,"COMPLETE");"
you can do that adding this code just below that line......
if (!(parentObject.WaitChild(ListViewObject, 500).exist)){
throw new UserException('ListViewObject not found');
}
p.s. replace parentObject from your actual parent object