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 reports and 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 the error to the log so that the rest of my tests show as green, if they pass?
Do While Sys.Process("iexplore").Exists
Re: Suppressing messages
You have a couple of options. If you enter a block in which you don't want anything posted to the log, you can just set Log.Enabled to false, then back to true again afterwards.
But for what you are doing, there may be a better way. The Sys.WaitProcess method does not post an error to the log if it fails to find the given process. Use that instead of referencing the Process("iexplore") directly.