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

Connecting popup window from modal popup is failing

4 Answers 248 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 25 Jan 2013, 05:12 AM
I have a test case in which i am connecting the popup from modal popup i.e: I have clicked on a button that opened a modal popup and then clicked another button on modal popup that button closing the modal popup and opening the new window.

So now connecting to the new windows is failing.

Log for the failure is:

'25-01-2013 10:33:09' - 'NotRun' : 7. Click 'TransparentSpacerGifImage'
'25-01-2013 10:33:19' - 'Pass' : 8. Wait for '10000' msec.
'25-01-2013 10:33:25' - 'Pass' : 9. [Contract_Test_CodedStep] : Connect to modal pop-up window : Contract -- Webpage Dialog, ConnectToPopup=True
'25-01-2013 10:33:41' - 'Pass' : 10. Click 'Test1Test1LabelTag'
'25-01-2013 10:33:41' - 'NotRun' : 11. Click 'ButBeginButtonTag'
'25-01-2013 10:33:55' - 'Pass' : 12. [Contract_Test_CodedStep5] : Click 'ButBeginButtonTag'
'25-01-2013 10:33:55' - 'NotRun' : 13. Close modal pop-up window : Contract Template -- Webpage Dialog
'25-01-2013 10:34:05' - 'Pass' : 14. [Contract_Test_CodedStep6] : Wait for '3000' msec.
'25-01-2013 10:34:28' - 'Fail' : 15. Connect to pop-up window : 'http://mytestapp/Con/main.aspx'
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'IsReady',Action:'NotSet',Target:'null',Data:'',ClientId:'660803f7-a19b-4012-b54f-f6514396e54c',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.TimeoutException: Timed out waiting for command to be handled
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId, Int32 timeout)
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)

InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'IsReady',Action:'NotSet',Target:'null',Data:'',ClientId:'660803f7-a19b-4012-b54f-f6514396e54c',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.TimeoutException: Timed out waiting for command to be handled
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId, Int32 timeout)
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
 ---> System.TimeoutException: Timed out waiting for command to be handled
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId, Int32 timeout)
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.IsReady()
   at ArtOfTest.WebAii.Core.Browser.WaitUntilReady()
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.HtmlDialogHandlerDescriptor.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.Extensibility.HtmlActionDescriptor.Execute(IAutomationHost autoHost)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

This is working fine with IE it is able to connect to the new window after clicking on button in modal popup. But it was failing FF and Chrome. Can you please guide me what can be done to make the test case work in all browsers?

4 Answers, 1 is accepted

Sort by
0
Avinash
Top achievements
Rank 1
answered on 25 Jan 2013, 05:53 AM
Hi,

To update my above thread, after some customization connection was happening properly with the popup window but while entering some text in the text-box in new popup window is failing with the exception:

"Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: Waiting for frame '[Frame:id=contentIFrame,name=contentIFrame,src=http://mytestapp/sub.aspx,UseQuery:False]' timed out. Error: Wait for condition has timed out" 

Then i saw the image captured at the time of failure, that image is showing Parent window not popup window. Is this means focus is at Parent window?

if focus is at parent window how to get the focus on to the popup window?

For more information:

i have used the below code before connecting the new popup window:

Manager.Wait.For<Manager>(manager => manager.Browsers.Count > 1, Manager, 20000)                                                                                                                                                                                                                                                                                                     Connection step is completed after above step, then i used the below code to set the focus to the new popup window:                                                                                                                                                                                                                                                          
Browser br= Manager.Browsers[1];
br.Window.SetFocus();

Above code is failed with exception that "System.ArgumentOutOfRangeException: Index was out of range" even though two browsers instances are in active state.                                                                                                                                                                          
 Can please guide me on this  so that i can proceed further? 






0
Ivaylo
Telerik team
answered on 29 Jan 2013, 09:36 AM
Hello Avinash,

Please note that you have already a thread opened regarding this very same issue. Could you please refer to the original forum thread here.

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 29 Jan 2013, 10:03 AM
Thanks for the reply Ivaylo.

This is a different issue. In the Thread  i am not able to connect to the Modal popup, connection step itself failed.

But in this thread i am able to connect to the Popup window but while entering some text in the text box it is giving exception. Connection step with the popup is completed successfully but i am not able to access the elements in the Popup window.
0
Ivaylo
Telerik team
answered on 01 Feb 2013, 09:34 AM
Hello Avinash,

Thank you for the clarification and the error provided, it seems you don't have the option SilverlightEnabled and that seems to be the root cause of the issue you are experiencing. If you are using Test Studio please go to Project tab > select your test and from the test properties check the box SilverlightEnabled. Please refer to the screenshot attached. If you are using the VisualStudio plugin please refer to this short video on how to enable the Silverlight for your test.

Greetings,
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
Avinash
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or