Can't view elements of Modal HTML Popup

6 posts, 1 answers
  1. wilfredo
    wilfredo avatar
    13 posts
    Member since:
    Jun 2011

    Posted 14 Jun 2011 Link to this post

    Have an link that will open an modal popup which is html. First thing is that i can't assert if the window is ready via pagetitle which is my first problem. Maybe if i can solve the first problem then maybe that's the time i can access the elements on it.

    By the way, the html pop up contains , dropdownlist, okay(image) and cancel(image) which are all clickable.

    Need your help.. Can't find any relate problem here that's why i started new thread. I also did read the documentation about the HTML Pop-up which i think it's not the same on mine but did the steps stated there but there's no luck.

  2. Answer
    Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 21 Jun 2011 Link to this post

    Hello Wilfredo,
         I was not able to reproduce this issue. Below is the code I used against the modal pop-up seen on this page:
    http://www.codestore.net/store.nsf/unid/DOMM-4R5MDQ
    It works correctly.

    // Launch an instance of the browser
            Manager.LaunchNewBrowser();
     
            // Navigate to : 'http://www.codestore.net/store.nsf/unid/DOMM-4R5MDQ'
            ActiveBrowser.NavigateTo("http://www.codestore.net/store.nsf/unid/DOMM-4R5MDQ");
     
            // Click 'ThisLinkLink'
            ActiveBrowser.Window.SetFocus();
            HtmlAnchor a = Find.ByContent<HtmlAnchor>("this link");
            a.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
            a.MouseClick();
            System.Threading.Thread.Sleep(1000);
     
            // Connect to modal pop-up window : A Modal Pop-Up -- Webpage Dialog
            if ((ActiveBrowser.BrowserType == BrowserType.InternetExplorer))
            {
                ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions ieActions = ((ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions)(ActiveBrowser.Actions));
                ieActions.ConnectIEDialog("A Modal Pop-Up -- Webpage Dialog", 5000);
            }
            Manager.WaitForNewBrowserConnect("http://www.codestore.net/store.nsf/unid/9F0D8552077A408686256999005AC70D/$file/si" +
                            "mple.html", true, 5000);
            Manager.ActiveBrowser.WaitUntilReady();
            Log.WriteLine(Manager.ActiveBrowser.PageTitle);
     
            // Click 'ThisIsInADiv'
            Find.ByContent<HtmlDiv>("This is in a modal dialogue. Use the X button to return to the main window.").MouseClick();
     
            // Close modal pop-up window : A Modal Pop-Up -- Webpage Dialog
            ActiveBrowser.Close();

    Regards,
    Stoich
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Saket
    Saket avatar
    22 posts
    Member since:
    Sep 2011

    Posted 13 Sep 2011 Link to this post

    Hi ,

    I am using the same snippet to connect to the modal dialog however the time taken to connect to the new modal dialog opened is so large that the application actually times out.
    I could see the modal dialog open and the focus on the required feild in the dialog but the code breakpoint is not hit
    any clue...
    help appreciated
  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 14 Sep 2011 Link to this post

    Hi Saket,
        try increasing the timeouts in the code. The following lines:
    ieActions.ConnectIEDialog("A Modal Pop-Up -- Webpage Dialog", 5000);
                            "mple.html", true, 5000);
    should have their respective timeout bumped up:
    ieActions.ConnectIEDialog("A Modal Pop-Up -- Webpage Dialog", 60000);
     
                            "mple.html", true,60000);

    This might do the trick. Let me know how it goes.

    Best wishes,
    Stoich
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Toldo
    Toldo avatar
    4 posts
    Member since:
    Jul 2012

    Posted 06 Sep 2012 Link to this post

    Hello,

    I am able to connect to modal dialogs opened in my tests. But I always need to do a MouseClick() instead of invoking onclick() event on the element with Click(true) for instance. Otherwise test will stuck on the click step.

    I am sure it is known issue since you also use the workaround in you samples. I just would like to know whether it is planned to be fixed in nearest future in order to allow opening Modal dialogs with JS when browser window is in background.

    Thank you in advance.
  6. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 11 Sep 2012 Link to this post

    Hello Toldo,

    We do not consider this behavior to be a bug that needs to be fixed. The problem is that when we send OnClick to the browser, the browser will not return control back to Test Studio until the popup modal window is closed.

    Regards,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top