Handle dialog "Leave site?"

1 Answer 170 Views
Dialog Test Recording
Adrian
Top achievements
Rank 2
Iron
Iron
Iron
Adrian asked on 07 Jun 2022, 04:15 AM

When I try and navigate away from a particular page on my site I get the following error as it thinks I have made a change but haven't;

"Leave site?

Changes that you made may not be saved."

2 options (buttons) "Leave" and "Cancel"

I want to click "Leave" but Test Studio does allow me to identify the leave button.

Any ideas how I get around this?

Thanks

Adrian

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 07 Jun 2022, 08:47 AM

Hi Adrian,

This is a standard OnBeforeUnload dialog generated from the browsers in specific cases. Test Studio recognizes the different dialogs and automatically adds a step to handle these depending on what action you performed against it while recording the scenario.

This particular dialog is a variation of the Confirm dialog, so it is being handled in Test Studio with that kind of step - Leave will be considered confirmation or 'OK', and the Cancel option is considered 'Cancel'.

Can you take the time to test if the handling the dialog while recording will add the necessary step into the test? Let me know if there is anything that bothers you.

Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Adrian
Top achievements
Rank 2
Iron
Iron
Iron
commented on 08 Jun 2022, 01:32 AM

Hi Elena,

Thanks for your help but still not working unfortunately.

It doesn't record the step when recording so I added the 'Handle 'Confirm' dialog' manually but it doesn't handle it.  I also tried the Handle Alert, prompt and generic dialog's which don't work either.

Any other suggestions?

Thanks

Adrian

Elena
Telerik team
commented on 08 Jun 2022, 11:18 AM

Hi Adrian, 

If applicable, I will recommend to upgrade your Test Studio and ensure the extension has no newer version. Then check the behavior of recording/execution for the OnBeforeUnload dialog and let me know if there is any difference. 

In addition, please, share which is the browser you use and its version?

Thank you for your cooperation once again.

Regards,
Elena

Adrian
Top achievements
Rank 2
Iron
Iron
Iron
commented on 20 Jun 2022, 05:00 AM

Hi Elena,

I finally got Test Studio upgraded to the latest version and this is now working using the "Handle Confirm dialog".

Thanks for your help.

Cheers

Adrian

Elena
Telerik team
commented on 20 Jun 2022, 07:09 AM

Hi Adrian, 

Thank you for the follow up. I am pleased to know that the latest version of Test Studio allows you to record and execute the 'Leave Site?' dialog correctly. 

Thank you for your cooperation.

Tags
Dialog Test Recording
Asked by
Adrian
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Elena
Telerik team
Share this question
or