Connecting to the modal popup failed with exception "Exception occured waiting for the new browser to connect"

5 posts, 0 answers
  1. Avinash
    Avinash avatar
    13 posts
    Member since:
    Dec 2012

    Posted 21 Jan 2013 Link to this post

    Connecting to the Model Popup failing in my Test Case.

    My scenario is I have to create a new record and i have to edit that record. While creating the record i am able connect Modal popup successfully with the below code.

    Manager.SetNewBrowserTracking(true);
    Manager.WaitForNewBrowserConnect("http://mytestapp/Tools/Subject/dialogs/edit.aspx", true, 5000);
    Manager.ActiveBrowser.WaitUntilReady();
    Manager.SetNewBrowserTracking(false);

    But while editing the same record it can't able to connect to Modal popup, because the URL is having query string .

    After removing the query string it is working in IE but failing in FireFox and Chrome

    Can you please guide me what can be done to make the test case work in all browsers?

    Log for the failure is:

    '21-01-2013 17:40:52' - 'Fail' : 25. [Sub_Test_CodedStep7] : Connect to modal pop-up window : Edit Subject - Microsoft Dynamics CRM -- Webpage Dialog, ConnectToPopup=True
    ------------------------------------------------------------
    Failure Information: 
    ~~~~~~~~~~~~~~~
    Exception thrown executing coded step: '[Sub_Test_CodedStep7] : Connect to modal pop-up window : Edit Subject - Microsoft Dynamics CRM -- Webpage Dialog, ConnectToPopup=True'.
    InnerException:
    System.OperationCanceledException: Exception occured waiting for the new browser to connect. ---> System.TimeoutException: Wait for condition has timed out
       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
       at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
       at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
       at ArtOfTest.WebAii.Core.Manager.WaitForNewBrowserConnect(String url, Boolean isPartial, Int32 timeout)


  2. Ivaylo
    Admin
    Ivaylo avatar
    782 posts

    Posted 23 Jan 2013 Link to this post

    Hello Avinash,

    Please note that the modal dialogs don't akt like standard HTML popup and they should be handled a bit differently. Please check the following article for more information.

    Hope this helps.

    Regards,
    Ivaylo
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Avinash
    Avinash avatar
    13 posts
    Member since:
    Dec 2012

    Posted 24 Jan 2013 Link to this post

    Thanks lvaylo,

    But as i said in earlier post my code working fine with IE after removing the query string and making bool isPartial equal to true 

    This is the complete code for connecting to the modal popup step:

    if ((ActiveBrowser.BrowserType == BrowserType.InternetExplorer))
    {
            ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions ieActions = ((ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions)(ActiveBrowser.Actions));
            ieActions.ConnectIEDialog("Edit Subject  -- Webpage Dialog", 30000);
    }
    Manager.SetNewBrowserTracking(true);
    Manager.WaitForNewBrowserConnect("http://mytestapp/Subject/edit.aspx", true, 30000);
    Manager.ActiveBrowser.WaitUntilReady();
    Manager.SetNewBrowserTracking(false); 

    This code is failing in Chrome and Firefox. So please help me to make this test case running.
  4. Avinash
    Avinash avatar
    13 posts
    Member since:
    Dec 2012

    Posted 29 Jan 2013 Link to this post

    Update for this Thread.

    As per my previous post i am creating the record and trying edit that record so while creating the record i am able connect Modal popup successfully, but editing the record failing while connecting to the Edit Modal Popup.

    Now i am not creating any record but i am editing the existing record, this test case is successfully connecting Edit Modal Popup and i am able to edit the record.

    If i add the creating record steps to above test case, test case failing at connection step to the Edit Modal Popup. 

    So my test case is passing if i do only editing, but it is failing when i create and edit the same record.

    Can you please suggest me on this?
  5. Ivaylo
    Admin
    Ivaylo avatar
    782 posts

    Posted 29 Jan 2013 Link to this post

    Hello Avinash,

    I have tried to use this standard code against a public available modal popup and I was not able to reproduce your issue. The test executes in Firefox and Chrome as expected. One thing you can do is to increase the timeout of the connect to the popup window step and give it a try.
    The other way we can proceed is if you record a sample test against your application containing a few steps and provide it along with access to your application so we can review this issue further.
    Please note that now we are communicating in a forum thread which is public available and if you are willing to provide any sensitive information you should open a support ticket where all the information remains private and confidential.

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