Problems with Confirmdialog when clicked on a anchor

5 posts, 0 answers
  1. Patrik
    Patrik avatar
    2 posts
    Member since:
    Jun 2010

    Posted 24 Feb 2011 Link to this post

    Hi
    I'm using webaii 2010.3.1421.0 and trying to handle a javascript Confirmdialog. 
    First I used a button element as button and everything worked OK, but I had replace the button with an anchor and the the dialog handling stopped working.

    The result after the change to an anchor is that the dialog popsup but after that nothing happends, the execution stop after the Find and Click statement.
    Tested using Chrome, and it works with this, but when I'm using Firefox or Internet Explorer. When I'm using Chrome my FindByContent stops to work. :(


    The code for handling the ConfirmDialog
    public void ClickAcceptButton(DialogButton clickButton)
    {
        var confirmDialog = new ConfirmDialog(TestContext.ActiveBrowser, clickButton);
        TestContext.Manager.DialogMonitor.AddDialog(confirmDialog);
        TestContext.Manager.DialogMonitor.Start();
                 
        Find.ById<HtmlAnchor>("accept").Click(false); //this was Find.ById<HtmlInputButton>("accept").Click(false);
        confirmDialog.WaitUntilHandled(5000);
                            
        TestContext.Manager.DialogMonitor.Stop();
    }

    HTML
    <a href='#' id='accept'>
        <span class='button-green'>Accept</span>
    </a>



    Thanks in advance!

  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 01 Mar 2011 Link to this post

    Hi Patrik,

    The code looks right to me for a standard Confirm dialog. Can you show me the JavaScript that launches your confirm dialog? I don't see that in the HTML snippet you posted. How does it get activated?

    You state "the execution stop after the Find and Click statement"... does it actually hang there permanently or does it timeout and error out after the 5 second delay you have coded in your WaitUntilHandled line of code?

    Kind regards,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Patrik
    Patrik avatar
    2 posts
    Member since:
    Jun 2010

    Posted 03 Mar 2011 Link to this post

    Hi

    Found out that the problem was not related to webaii. I upgraded an addin to visual stuido at the same time I did the change and it was that which caused the error.

    /patrik
  4. Mahendra Kumar
    Mahendra Kumar avatar
    17 posts
    Member since:
    Feb 2010

    Posted 28 Nov 2011 Link to this post

    Hi Patrik,

    Can you please let me what exactly you did to fix that issue, since I am also running into similar kind of issue with firefiox.

    Thanks in advance,
    Mahendra
  5. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 01 Dec 2011 Link to this post

    Hello Mahendra Kumar,

    Can you provide more detail on the exact error you're getting? Please also include your dialog handling code and the HTML you're testing against. Even better, if the site you're testing is publicly accessible, provide the link so we can run your code for ourselves and see the issue first-hand. 

    Greetings,
    Anthony
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top