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

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

4 Answers 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 21 Jan 2013, 01:24 PM
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)


4 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 23 Jan 2013, 02:57 PM
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
0
Avinash
Top achievements
Rank 1
answered on 24 Jan 2013, 09:40 AM
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.
0
Avinash
Top achievements
Rank 1
answered on 29 Jan 2013, 08:29 AM
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?
0
Ivaylo
Telerik team
answered on 29 Jan 2013, 09:43 AM
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
Tags
General Discussions
Asked by
Avinash
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Avinash
Top achievements
Rank 1
Share this question
or