Ask a Question

How to handle UnexpectedWindow/Overlapping window using the script or General Events?

SOLVED
bommareddy
Contributor

How to handle UnexpectedWindow/Overlapping window using the script or General Events?

Hi All,

 

My application throws popup for every 3-5 Min. Script can proceed further by clicking on Ok button in the popup.

 

But how to recognise this popup using testcomplete dynamically?

 

Ex: While running the script, In middle if any popup appears TestComplete is not triggering it as UnexpectedWindow/Overlapping window. So that the webpage objects are going to "VisibleOnScreen=False" due to this popup. If objects are in Invisible state, we can't proceed further.

 

Please find the screen shot of the unwanted popup in the application and also Let me know if your require any other details in this regard.

PopUp.JPG

 

 

Regards,

BommaReddy

 

17 REPLIES 17
tristaanogre
Esteemed Contributor

As I understand it, the TestComplete event for Unexpected/Overlapping window triggers if you attempt to interact via mouse click or keystroke with a component on the underlying window. So, whether or not the component is visible on screen shouldn't matter to TC. Do you have code or something in your tests to check for "VisibleOnScreen" before proceeding? If so, you may want to modify that to only check the "VisibleOnScreen" property when it is necessary to do so.

In any case, once the unexpected/overlapping window event gets triggered, you can create an event handler that will do the necessary button click as you described. See https://support.smartbear.com/viewarticle/84027/ for more information.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi Tristaanogre thanks for your reply.

 

My code:

1. Set objAbc = xyz
2. aqUtils.Delay 5000
3. objAbc.Click

 

Consider this as example. During the execution process of the second line, the Unexpected/Overlapping window triggers. At Line 3, i am trying to click on objAbc object. But the "objAbc" is "VisibleOnScreen=False". 

 

I am performing click action on the main webpage. During this general events are not triggering(Unexpected/Overlapping) for this event.

 

I have return seperate code in eventHandlers

   Sub OnOverlappingWindow(Sender, Window, OverlappingWindow, LogParams)
        'code to handle overlapping/Unexpected window
   End Sub

 

Regards,

BommaReddy

 

 

As noted in the support article that I linked, there are certain situations where the overlapping window event doesn't fire. Please check your application to see if it meets those criteria. If so, you may need to write your own code so that, before interacting with your main application, you check for the popup.  Something like:

 

Set objAbc = xyz
aqUtils.Delay 5000
CheckAndClosePopup()
objAbc.Click

where the function CheckAndClosePopup would have something like

 

if (MyApp.WaitChild('PopUpWindow', 100).Exists){
    MyApp.PopUpWindow.OKButton.Click()
} 

That's the best I can do for you. There could be other ways using timers and such but that might end up putting a heavier load on your test project performance.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi

 

Instead of checking every time in the script for a popup, Is there any built in function/Event which triggers automatically when Unexpected/Overlapping Panel occurs for the web based application?

 

Regards, BommaReddy

Yes, there is (see https://support.smartbear.com/viewarticle/84027/) but as noted in that same article, there may be situations that will not trigger that event. So, you can first of all try the event handler for the overlapping window (which you've already attempted by your original post) or you can do what I suggested.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Thanks dude for your support Smiley Happy

 

Is there anyway to identify Model Window popup dynamically while script execution process i.e like General Events(UnexpectedWindow/Overlapping)?

 

 

Regards, BommaReddy

There's not a way to create custom events to be handled in the same way.

 

However, you could create a Timer Object (https://support.smartbear.com/viewarticle/82264/) that would execute every so many seconds. It's not an event handler necessarily but you could set up a timer that would check to see if the window exists and, if it does, click the OK button on it.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi Team,

 

Is there any way to identify the window based(windowless) popup, Just like to identifying UnexpectedWindow/Overlapping.

 

We can handle this popup if it appears by clicking on a button/link. 

 

But my situation is, I exactly don't know when this popup will be triggered and I want to handle this popup without disturbing the script execution.

 

Regards, BommaReddy

cancel
Showing results for 
Search instead for 
Did you mean: