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

Unable to find target host using Sharepoint Javascript popup

4 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 14 Sep 2011, 06:24 PM
I am evaluating Test Studio for purchase but I've run into a problem.  I am testing a web application running inside Sharepoint 2010.  The app makes extensive use of modal popups using the Sharepoint javascript library [SP.UI.ModalDialog.showModalDialog(dOpt);] which are actually contained in an iframe.

I can record the test fine, but on playback I get an error when I tray to select or valdiate an element on the popup:

Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Int32 timeout)
   at ArtOfTest.WebAii.Core.Browser.WaitForFrame(FrameInfo frameInfo, Int32 timeout)
   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.GetFrameBrowserInstance(Browser topBrowser, FrameInfo frame, Int32 waitTimeout, String& stringError)
InnerException:
System.Exception: Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Int32 timeout)
   at ArtOfTest.WebAii.Core.Browser.WaitForFrame(FrameInfo frameInfo, Int32 timeout)
   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.GetFrameBrowserInstance(Browser topBrowser, FrameInfo frame, Int32 waitTimeout, String& stringError)
   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.WaitForAllElements(IAutomationHost host, AutomationDescriptor descriptor, Int32 timeout)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)


How can I get around this?

Thanks:

William Fedders
Aptera

4 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 14 Sep 2011, 11:11 PM
Hi William,

Since you also filed a support ticket on this issue and attached files to that support ticket, we will respond there.

All the best,
Cody
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
0
El_Topo
Top achievements
Rank 1
answered on 05 Mar 2012, 02:54 PM
Has this support ticket been resolved? Could someone provide the resolution? I am experiencing the same problem.

Seems like, the reason for this issue is that every popup dialog in SharePoint becomes new object within Test Studio with different, randomly generated id (i.e.: DlgFrame08575e54-a052-40ba-9eae-7b24e34ab5ae) and random FriendlyName.

I have made a recording where I entered simply two items into SharePoint list (using the same new form dialog). As it is visible on the attached screen - test studio created two different instances of frame dialogs: FrameDlgFramebaa64c4Eb00 and FrameDlgFramef2995ea519b0.

During playback, Test Studio is attempting to find dialog frame with particular FriendlyName and fails (since newly oppened dialog receives new random name).

Maybe the resolution would be to use code to find the frame dialog in DOM basing on part of frame friendly name (like 'FrameDlgFrame'). Any idea how this could be done?
0
Cody
Telerik team
answered on 05 Mar 2012, 04:24 PM
Hello El_Topo,

Yes it was. It turned out to be a dynamically generated ID is the iframe elemen. Here's a copy of that response:

Hi William,

Thanks for posting the error and screenshots. The error message "Unable to find target host" means that for some reason the frame is not being found. When you're testing elements inside of a frame there is an URL which is used to connect to the frame. Please make sure the URL is correct.
 
Another reason for this error could be a dynamically generated ID  "DlgFramef1b84c1a-3014-4e8e-a218-66dfb8c34931" you can try using this expression instead "~DlgFrame" in the ID field, as shown on the screenshot.  

If this doesn't help, the best and the fastest way to troubleshoot this, is to reproduce the issue locally. Is remote access to your site possible? If it is not possible, perhaps you can point us to a public site that demonstrates the issue. 

Hope to hear from you soon!

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
El_Topo
Top achievements
Rank 1
answered on 07 Mar 2012, 09:27 AM
Thanks!
Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
Cody
Telerik team
El_Topo
Top achievements
Rank 1
Share this question
or