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

How to type the text in the TinyMCE editor?

4 Answers 328 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 10 Jun 2010, 01:53 PM
When I try to SetText() in tinyMCE editror,  WebAii haven't found a frame that contains body with text.
I use code:
Browser ie = manager.ActiveBrowser;
Browser fr = ie.Frames.ById("content_ifr");


But fr = NULL after that.
How to set the text into body in this frame?
And next one question: how I can to allocate the <body>?  I guess this code is wrong, but I can't check it (can't found a frame):
Element fr_body = fr.Find.ByTagIndex("body", 0);
fr.Actions.SetText(fr_body, "text");

4 Answers, 1 is accepted

Sort by
0
Missing User
answered on 10 Jun 2010, 11:26 PM
Hi Sergey,

Thanks for the post and repro information. Please try adding the line:
 
ActiveBrowser.WaitForFrame(new FrameInfo("content_ifr","","",0), 5000);
Browser ie = manager.ActiveBrowser;
Browser fr = ie.Frames.ById("content_ifr");

All the best,
Nelson Sin
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.
0
Sergey
Top achievements
Rank 1
answered on 11 Jun 2010, 10:18 AM
Hi Nelson,
Thanks a lot, now Its working! That I call the "true support"!

But how can I set the text into <body> in tinyMCE editor. SetText() method is not suport <body> element:
System.ArgumentException : Target '[Element: 'body:0' (id=tinymce)]' is not a support element to set text to.
I use this code:
manager.ActiveBrowser.WaitForFrame(new FrameInfo("content_ifr""""", 0), 5000); 
Browser ie = manager.ActiveBrowser; 
Browser fr = ie.Frames.ById("content_ifr"); 
Element fr_body = fr.Find.ById("tinymce"); 
fr.Actions.SetText(fr_body, "sdfsdf"); 

0
Missing User
answered on 11 Jun 2010, 10:10 PM
Hi again Sergey,

Please try:

HtmlControl fr_body = fr.Find.ById<HtmlControl>("tinymce");
fr_body.MouseClick(MouseClickType.LeftDoubleClick);
fr_body.MouseClick();
Desktop.KeyBoard.TypeText("Type Text", 500);

Also, please check out the WebAii Documentation and the installed WebAii Example Test Project for reference.

Best wishes,
Nelson
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.
0
Sergey
Top achievements
Rank 1
answered on 14 Jun 2010, 06:28 AM
Thanks a lot, Nelson!
Tags
General Discussions
Asked by
Sergey
Top achievements
Rank 1
Answers by
Missing User
Sergey
Top achievements
Rank 1
Share this question
or