I am testing a WPF application using QTP 9.5. I have a Function in a .QFL file which checks if a Window exists. If it does, then the function Closes the window. If the window was not found, there is no action taken.
My problem is that when window does not exist the WpfWindow("SampleWindow").Exist(0)statement returns a Run error in the results file. The Run error states that SampleWindow object was not found.
Is it possible to avoid getting these run errors? This messes up the actual error count. Is there another way to check if window exists without generating an error message. My sample code is below -
If WpfWindow("Window1").Exist(0) Then
Reporter.ReportEvent micDone,"Window check","Window is already closed"