Unable to find target host using Sharepoint Javascript popup

5 posts, 0 answers
  1. William
    William avatar
    1 posts
    Member since:
    Sep 2011

    Posted 14 Sep 2011 Link to this post

    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
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 14 Sep 2011 Link to this post

    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
  3. El_Topo
    El_Topo avatar
    2 posts
    Member since:
    Aug 2012

    Posted 05 Mar 2012 Link to this post

    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?
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 05 Mar 2012 Link to this post

    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
  5. El_Topo
    El_Topo avatar
    2 posts
    Member since:
    Aug 2012

    Posted 07 Mar 2012 Link to this post

    Thanks!
Back to Top