Unable to find the elements in IFrame

2 posts, 0 answers
  1. Hamza
    Hamza avatar
    3 posts
    Member since:
    Jul 2015

    Posted 21 Jul 2015 Link to this post

    I am trying to create a UI test for an ASP.NET web site hosted in SharePoint 2010 using Test Studio. I am using WS2008 and IE10 for testing.

    I am having a problem while getting element within an iFrame. This iFrame is created dynamically on click a link and loaded within a HTML page under the current page.

     I think that the iFrame is not loaded in the DOM and this is why I am getting error while accessing elements in the iFrame.

    Can you please provide me a way to access elements in the iFrame?

     PFB, the error I have got in the log file:

    Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure waiting for frane '[Frame:id=DlfFrame1bc2fae4-baa8-45e1-9331-88asdlaewrfkdj,name=Frame_2,src=http://contoso.com/_layouts/listform.aspx,UseQuery:False]' time out. Error: Wait for condition has timed out.

     Thank you in advance.

  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 24 Jul 2015 Link to this post

    Hello Hamza,

    As I can see from the find expression the ID is dynamically generated and that's why Test Studio cannot find it.

    Please remove the ID from the frame's find expression and give that a try.

    See this article for further information.

    If the issue persists please try also add this coded step before find the element/frame:


    Let me know if this helps.

    Boyan Boev
Back to Top