Forum Discussion

jmassey's avatar
jmassey
Contributor
8 years ago

OnOverlappingWindow Event works, but error still occurs

 

So, the Warning log there happens at the start of my OnOverlappingWindow event. The Keyboard input is just pressing 'Esc' (the overlapping window in this case happens to be a tooltip, so this should work fine). It actually does clear the tooltip. Then that 'window was clicked with the left mouse button' is the test actually moving along successfully from the point where it was interrupted. Everything seems to be in order...except for some dang reason the Overlapping Window error still happens, and it kills my test. I don't want to disable Stop On Error, but when an error is handled correctly and I'm able to move on, why is it still making my test fail?

 

Here is the function in full that runs when that event happens. Everything in it seems to be functioning just fine:

 

def GeneralEvents_OnOverlappingWindow(Sender, Window, OverlappingWindow, LogParams):
    aqUtils.Delay(2500)
    Log.Warning('Overlapping Window')
    Log.Picture(Sys.Desktop.Picture(0, 0, -1, -1))
    Sys.Keys('[Esc]')    
    aqUtils.Delay(250)
    if OverlappingWindow.Exists:
        if OverlappingWindow.Visible and \
            OverlappingWindow.VisibleOnScreen:        
            if hasattr(OverlappingWindow, Minimize):
                Log.Warning('Attempting to minimize Overlapping Window')
                OverlappingWindow.Minimize()
    aqUtils.Delay(2500)

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    It's making your test fail because an OverLappingWindow event that has an unmodified LogParams will log an error.  What you need to do is modify the properties of LogParams to change what is automatically logged from an error to a warning or, even, completely bypass the logging.

    • jmassey's avatar
      jmassey
      Contributor

      Okay. Why is it different than UnexpectedWindow, and what would I do if I want it to behave the same way? How do I modify LogParams?