Pop-up Error Box a child of main window
I am trying to code IF/ELSE statements when an error occurs on my AUT. The application is Eclipse based (standard windows). It appears that the pop-up error boxes are children of the Main Window. Also, it appears that when instructed by QTP to activate the main window when a pop-up box is present, it can find it (when it shouldn't be able to due to the pop-up).
So that leads me to believe that QTP doesn't recognize the pop-up window as being in focus or even present. My line of code is:
IF Window(" ").Exist THEN
It should find the IF as false and skip to the ELSE; however, it finds it as True and tries to activate the Window, in vain since there's a pop-up.
Has anyone experienced this, and if so, what was the workaround?
Re: Pop-up Error Box a child of main window
This post should have been in the QTP forum, but try this...
Instead of doing "Window("").Exist" find a button on the POP-UP and do an Exist on it. Example:
IF Window("Main").Dialog("POP-UP").Button("OK").Exist THEN
I am just reversing the conditions with this so I check for the error to exist instead.
The problem with pop-ups in Win9x/2K/XP is that they don't block QTP from SEEING that the parent window exists, they just won't let you USE the parent window, so QTP will still see the parent as existing because it actually still does, it is just not active. Unfortunately I don't know off the top of my head if there is an "ACTIVE" property you could check instead, but you might look for one...
Hope this helps.