Using JavascriptExecutor to type text in a rich text editor box 

This is a solution for the Selenium Webdriver Type command not working on IE when you are trying to enter some text in a rich text editor. You can use the below code to execute the command in IE and other browsers.

((JavascriptExecutor)driver).executeScript("document.getElementById('ElementID').value='TextValue'");

The rich text editor is usually placed in a iFrame.


Author: Pavandeep Puddupakkam on February 20, 2012
Category: WebDriver
Tags: , ,
Selenium Webdriver Forum -The Online Community for Selenium Webdriver and Selenium RC Users and Professionals
1 response to “Using JavascriptExecutor to type text in a rich text editor box”
  1. santosh says:

    can u provide us an example of it.. it would be helpful…

Leave a Reply

Last articles