Forum Discussion

dsolis2's avatar
Occasional Contributor
15 years ago

Supress Log Messages or Catch failures

I am running the following routine to close all open browsers at the beginning of my tests. The function performs as expected, but when the loop no longer encounters a browser, it writes an error to the log: "Process not found"

The problem is that the error causes the entire report to show there was an error in the test. How do I supress the routine from writing it to the log so that the rest of my tests show as green if they pass? 

Function fCloseAllBrowser()

Do While Sys.Process("iexplore").Exists

    Sys.Process("iexplore").Close 'Kill the process 


End Function