Unable to capture my actions on Rich Text Editor in PHP page

14 views
Skip to first unread message

satish tulasi

unread,
Jun 25, 2010, 2:56:04 AM6/25/10
to seleniu...@googlegroups.com
Hi All,
 
I am new to Selenium and was assigned the task to automate a scenario to upload set of data (types of questions) to the website.The question should be typed in RichTextEditor and then it should be saved. I have to automation this process as there are lot of questions and manually its time taking.
 
Problem:
 During recording Selenium is capturing all the events but except one event when I type some text in RichTextEditor it does not record or capture that event. Please help me understand how to resolve this issue.
 
Thanks,
Satish 

Moises Siles

unread,
Jun 25, 2010, 10:57:09 AM6/25/10
to seleniu...@googlegroups.com
I remember a similar case using a RichTextEditor, and the problem was the frame, to type something in the RTE I had to access the frame, looks the this line vSelenium.Type("//body", "Selenium Question!");

I did the following in C#

                // Add the Question in the RTE
                vSelenium.Click("//div[@id='math_help_problem_question_tab_header']/span[2]");
                Thread.Sleep(2000);
                vSelenium.SelectFrame("question_rte");
                vSelenium.Type("//body", "Selenium Question!");
                vSelenium.KeyDown("//body", "!");
                vSelenium.KeyUp("//body", "!");
                Thread.Sleep(5000);
                vSelenium.SelectWindow("null");
                vSelenium.Click("//img[@onclick='javascript:submitQuestion();']");
                Thread.Sleep(5000);
                Assert.IsTrue(vSelenium.IsElementPresent("//a[contains(text(),'Selenium Question!')]"));
                Assert.AreEqual("Selenium Question!", vSelenium.GetText("//a[contains(text(),'Selenium Question!')]"));

maybe that helps...
Thanks

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Linh Vu

unread,
Jun 25, 2010, 11:30:17 AM6/25/10
to seleniu...@googlegroups.com
You must select frame which contains RichTextEditor
--
Mr. VuThe Linh
eXo Platform SEA
8 Flr, Thaiha building, 18/11 alley, Thaiha Str, Hanoi
Skype: vu.the.linh
website:www.exoplatform.com
Phone : +84 984 303 104

Niraj Kumar

unread,
Jun 25, 2010, 11:38:49 AM6/25/10
to seleniu...@googlegroups.com
Hi Satish,
You can create one function and use it

public void SetText(String iframeDescription){
         String str= "{"+
          " var doc=selenium.browserbot.getCurrentWindow().document;" +
          "doc.getElementById('rte').contentWindow.document.body.innerHTML='"+iframeDescription+"';"+ "}" ;
           selenium.getEval(str);
        }

In the above function pass your text editor id on the place of 'rte'
like doc.getElementById("your text editor id").contentWin............

For using above function just use as method

SetText("This is the text");


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.



--
Thanks & Regard,
Niraj Kumar

The Vagabond

unread,
Jun 25, 2010, 7:22:47 AM6/25/10
to Selenium Users
Try the keyPress methods
Reply all
Reply to author
Forward
0 new messages