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

Target is not a supported element to set text to

2 Answers 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 15 May 2012, 12:25 PM
Hi Telerik Team,

I am getting below error while inserting text textbox in FF but same code is working fine with IE.

Target '[Element: 'iframe:0'' is not a supported element to set text to. at ArtOfTest.WebAii.Core.Actions.SetText(Element targetElement, String text) at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.SetTextActionDescriptor.Execute(Browser browser) at ArtOfTest.WebAii.Design.Extensibility.HtmlActionDescriptor.Execute(IAutomationHost autoHost) at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

What could be the reason?

2 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 16 May 2012, 07:44 AM
One more update, element that I am searching for(e.g with Id = 'ABC') is of type <DIV> in IE but same element is of type <iFrame> in FF,I observed this in DOM.
In the attached file see element with id=ABC.
0
Plamen
Telerik team
answered on 16 May 2012, 11:37 AM
Hello John,

Thank you for the screenshot. The problem is that sometimes alternative browsers don't properly render the page DOM tree. Since the element is rendered as an <iFrame>, it's simply impossible to set its text with a regular 'SetText' step.

The alternative to this is to invoke a "Blind" Keyboard Typing, using code like this:
Manager.Desktop.KeyBoard.TypeText("This is a sample",200);

Make sure your control has input focus and is in input mode prior to the keyboard typing.

Greetings,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or