Navigate to different page dialog handler

6 posts, 0 answers
  1. Reinout
    Reinout avatar
    15 posts
    Member since:
    Jan 2014

    Posted 22 Jan 2014 Link to this post

    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
  2. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 27 Jan 2014 Link to this post

    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!
  3. Tori
    Tori avatar
    13 posts
    Member since:
    Jun 2014

    Posted 23 Oct 2014 in reply to Reinout Link to this post

    Hello Reinout,

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

    Thanks,
    Tori
  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 28 Oct 2014 Link to this post

    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!
  5. Tori
    Tori avatar
    13 posts
    Member since:
    Jun 2014

    Posted 29 Oct 2014 in reply to Boyan Boev Link to this post

    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
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 30 Oct 2014 Link to this post

    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!
Back to Top