This is a migrated thread and some comments may be shown as answers.

Navigate to different page dialog handler

5 Answers 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Reinout
Top achievements
Rank 2
Reinout asked on 22 Jan 2014, 02:14 PM
Dear Telerik,

I am trying to navigate to a different page, but before I can do this, a dialog appears (the IE "leave this page" or "stay on this page" dialog).
I would like to leave the page and go to an other URL.

I already tried several things; using the onbeforeunload handler and by using invoked keypresses. But I cannot get this to work on my test lists while running remotely.

Onbeforeunload:
OnBeforeUnloadDialog dialog = OnBeforeUnloadDialog.CreateOnBeforeUnloadDialog(ActiveBrowser, DialogButton.OK);
Manager.DialogMonitor.AddDialog(dialog);
ActiveBrowser.NavigateTo("/ExterneAanroep.aspx?pagina=wachtwoord-activeren", true);
dialog.WaitUntilHandled(10000);
I also tried to use this.Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;, because my testlist needs the global setting set at "Do not handle", but still no success.

Keypress:
ActiveBrowser.NavigateTo("/ExterneAanroep.aspx?pagina=wachtwoord-activeren", true);
Manager.Desktop.KeyBoard.KeyPress(Keys.Enter, 200);
And added the reference system.windows.forms to my project and to the cs file.

What am I missing here?

Regards,
Reinout

5 Answers, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 27 Jan 2014, 12:28 PM
Hi Reinout,

I am sorry to hear that  you are experiencing this issue.

In order to help you best we will need some more information:

1) What happens if you try to execute the same test list locally? Does this problem happen only when you execute the test list remotely? If so - can you handle other types of dialogs, like alert dialogs

2) Does it make any difference if you set the global test list setting for UnexpectedDialogAction to HandleAndContinue

3) Please also provide your test failure logs (there should be at least 3 files in the export). You can export these to file from the failure tab of your test and add them to a .zip.  These files can help us determine better what was the reason for the failure of your test.


For the workaround with keystrokes, you can try to add a little delay:
ActiveBrowser.NavigateTo("/ExterneAanroep.aspx?pagina=wachtwoord-activeren", true);
System.Threading.Thread.Sleep(3000);
Manager.Desktop.KeyBoard.KeyPress(Keys.Enter, 200);

Looking forward to hearing from you.

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Tori
Top achievements
Rank 1
answered on 23 Oct 2014, 06:37 PM
Hello Reinout,

I have almost exactly the same situation. Did you ever find a solution?

Thanks,
Tori
0
Boyan Boev
Telerik team
answered on 28 Oct 2014, 11:19 AM
Hi Tori,

Have you tried the Velin's suggestions?

If you still experience this issue please describe in details your scenario so we can assist you best.

Hope to hear from you soon. 

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Tori
Top achievements
Rank 1
answered on 29 Oct 2014, 01:19 PM
Hello Boyan,

Yes I did try Velin's approach, but still could not dismiss / close the confirm dialog.  I have a separate thread where we are working with this problem at the link below.  I have a few suggestions to try today, so I'm keeping my fingers crossed that we will be able to fix the problem.

http://www.telerik.com/community/forums/using-extractedvalue-in-regular-step-condition

Thanks,
Tori
0
Boyan Boev
Telerik team
answered on 30 Oct 2014, 02:38 PM
Hi Tori,

Thank you for the information.

Please continue the discussion with my colleague Cody to avoid duplicate posts.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Reinout
Top achievements
Rank 2
Answers by
Velin Koychev
Telerik team
Tori
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or