Ask a Question

How to Handle Unexpected Window

xx97
Occasional Contributor

How to Handle Unexpected Window

Hi everyone, I'm working on automated testing for my application. When I start my app with different settings, an unexpected window will appear.

I already went through all the documentation and also the questions in community, still not quite understand how OnUnexpectedWindow works, can someone help me on that?

 

My steps:

1. Record a keyword test for the pop up window.

2. Add an event for OnUnexpectedWindow.

3. Run the keyword test under OnUnexpectedWindow script.

 

Thanks a lot.

3 REPLIES 3
SBegley
Staff

Hi @xx97 

 

I hope you are keeping well.

 

We have the following video guide on Dealing With Unexpected Pop Ups which goes over the steps to implement this.

 

I've set up the OnUnexpectedWindow and similar to your steps its ;

 

1. Record a keyword test to handle / interact with the pop up window.

2. Add an event control for OnUnexpectedWindow

3. Add keyword test under OnUnexpectedWindow script.

 

When running the Keyword Test and if a pop up window occurs the OnUnexpectedWindow handler will run the keyword script to handle/interact with the pop-up.

 

Does the Event Handler / OnUnexpectedWindow handle your pop-up?

 

Please let me know if the video helps resolve your query or if you have any additional questions.

 

Thanks,

Shane

 

 

 

xx97
Occasional Contributor

Hi Shane, thanks for the reply, but it still cannot handle my pop-up.

Do I need to add the Event Handler to execution plan if I have more than one keyword test?

And is it related to Playback > On error in project settings as I have saw some documentation which mentioned about this?

 

Thanks.

SBegley
Staff

Hi @xx97,

 

I've been testing a few scenario's, within the Execution Plan I'm using "Use projects 'On Error' property" and each time an unexpected pop-up occurs the event from "OnUnexpectedWindow" handles this successfully for me.

 

I've been using the following video guide on Dealing With Unexpected Pop Ups

and set up the OnUnexpectedWindow and similar to your steps;

 

1. Record a keyword test to handle / interact with the pop up window.

2. Add an event control for OnUnexpectedWindow

3. Add keyword test under OnUnexpectedWindow script.

 

There was no additional steps take to implement the OnUnexpectedWindow, if you can share any screenshots of what you've configured it may help with troubleshooting the issue your experiencing.

 

Kind Regards,

Shane

cancel
Showing results for 
Search instead for 
Did you mean: