Unable to focus on frame

2 posts, 0 answers
  1. Archana
    Archana avatar
    1 posts
    Member since:
    Jul 2020

    Posted 09 Jul Link to this post

    Hi ..

    I tried to locate iframe in my application but focus not going facing null exception.

    Below code I used

                    Browser myFrame = Manager.Current.ActiveBrowser.Frames.ById("iframe1"); myFrame.RefreshDomTree();
                    HtmlControl bodttag = myFrame.Find.ByTagIndex<HtmlControl>("body", 0);
                    bodttag.Focus(); bodttag.MouseHover(); bodttag.Refresh();
                    HtmlControl text = bodttag.Find.ById<HtmlControl>("50002"); text.Focus(); text.MouseHover(); text.MouseClick();


    Attached console for your reference.Kindly provide alternate solution for it.

  2. Plamen Mitrev
    Plamen Mitrev avatar
    264 posts

    Posted 10 Jul Link to this post

    Hello Archana,

    Google Chrome browser introduced some additional security features for cross-domain frames with version 80 and above. As a result some users have experience issues, trying to access an element from iFrame, which is not in the same domain.

    We immediately recognized those changes and release updates to the framework and Test Studio products. Please make sure that you have updated to the latest version and that  the browser is calibrated. If you are using the Telerik Testing Framework, you need to configure your browser with the respective line of code, before the browser is started. That should be done, when all instances of the browser are closed, otherwise some changes will not take affect.

    I hope the above suggestion will help you configure the browser and automate this test scenario. If you encounter any troubles, please share more details about your environment, like:
    - do you use the framework and which version do you have?
    - what is the version of Chrome browser that you are using?
    - what is the version of the Test Studio Extension that you have added?
    - execute the test against calibrated Internet Explorer and Microsoft Edge Chromium browsers and let me know what is the behavior.

    Thank you for your cooperation in advance.

    Plamen Mitrev
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top