Forum Discussion

Madhi's avatar
Madhi
Contributor
15 years ago

Disable error log

I have a situation where i need to disable error log temporarily.  I have to check if a window exists or not if it does not exist i do not want any error message in the log file.  can i disable temporarily and enable again.  WaitWindow and WaitProcess does not work either.

7 Replies

  • Hi,



    What do you mean by "WaitWindow and WaitProcess does not work"? How do you use them?

    What is the exact name of the object you need to obtain?

  • I need to wait for a window to open, and it takes invariably from 10-15 secs.  Even if I use waitwindow or waitprocess, by the time the window opens i get error logged.
  • Hi,



    Use the appropriate timeout. If your window opens within 15 seconds, the timeout should be no less than this time.



    Again, exactly how do you use WaitWindow and what is the exact name of the object you need to obtain?

  • Jared:

    While Sys.Process("something").WPFObject("HwndSource: SingleEngagementView").WPFObject("SingleEngagementView").WPFObject("LayoutRoot").WPFObject("Grid", "", 1).WPFObject("Border", "", 1).exists = False

    BuiltIn
    .delay(1000)

    Wend

    I get a error in the log until the window appears - how to avoid the error log.

  • Hi,



    You need to use the WaitWPFObject method here and check all objects that may not exist, not only the last one in the hierarchy.

  • Do you mean to say my statement should look like

    Sys.waitProcess("something").waitWPFObject("HwndSource: SingleEngagementView").waitWPFObject("SingleEngagementView").waitWPFObject("LayoutRoot").waitWPFObject("Grid", "", 1).waitWPFObject("Border", "", 1).method...








  • Hi,



    No. Start with the following code:

    Set parentObj = Sys.Process("something").WPFObject("HwndSource: SingleEngagementView").WPFObject("SingleEngagementView").WPFObject("LayoutRoot").WPFObject("Grid", "", 1)

    Set obj = parentObj.WaitWPFObject("Border", "", 1, 5000)

    If obj.Exists Then ' object found




    If this doesn't help, check the target object's parents in the same way.