Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
15 days ago

An intelligent OnUnexpectedWindow Event Handler

I’m not sure if this is possible but, just in case someone out there has come up with any sort of solution, I thought it wouldn’t hurt to ask. Here’s what I have envisioned.

First, I assume it would be necessary to figure out the correct settings for the Error Handling and On unexpected window sections of the Playback options. I have tried several different settings and various combinations and I can’t get it to work for my purposes

 

 

Next, would be setting up the OnUnexpectedWindow event handler so that the following process is followed:

  1. A keyword test or script routine execution is in progress.
  2. An action (such as a mouse click) is attempted but an unexpected window with an OK button has popped up.
  3. Control is transferred to the OnUnexpectedWindow event handler (see below) and the window is handled.
  4. Control is returned to the keyword test or script routine and the onscreen action in step 1 is completed.
  5. Normal execution resumes.

My concept of the event handler is a switch/case statement based on the Name property of the Window object that gets passed into the event handler. Even though it doesn’t show it, I would probably like to be able to interrogate any caption that might be on the window that has popped up because some pop ups might have both a Yes and a No button and which one to click might depend upon text in the caption. I mean if that Window is the actual object representing the form object of the popup window then shouldn’t I be able to access it’s children such as Static, WndCaption, btnOK, etc.?

 

 

So has anyone out there ever attempted anything like this with unexpected windows? Let me know if you need me to provide any additional information. 

 

 

No RepliesBe the first to reply