Tuesday, March 29, 2011

Automate rich text editor

Using selenium 1.0 difficult to Automate rich text editor, i have wasted my whole day to automate rich text editor , finally i got success.

to automate following type of rich text editor :

As selenium IDE will not record any text entering in to text area. we need to add manually


        selenium.selectFrame("//table/tbody/tr[2]/td/iframe"); //frame location
        selenium.typeKeys("//html/body/p/br", comment_fromdrupal);
        selenium.selectWindow("null");
        assertTrue(selenium.isElementPresent("edit-submit"));
        selenium.click("edit-submit");


so, for frame position, search using xpather, and use typeKeys.

No comments:

Post a Comment