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

[Solved] Unable to focus on frame

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Archana
Top achievements
Rank 1
Archana asked on 09 Jul 2020, 08:12 AM

Hi ..

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

Below code I used

               ActiveBrowser.RefreshDomTree();
                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();
                Thread.Sleep(4000);

 

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

1 Answer, 1 is accepted

Sort by
0
Plamen | Lead Technical Support
Telerik team
answered on 10 Jul 2020, 08:50 AM

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.

Regards,
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.
Tags
General Discussions
Asked by
Archana
Top achievements
Rank 1
Answers by
Plamen | Lead Technical Support
Telerik team
Share this question
or