I have a text editor on a web page, I need to fill in its value using selenium scripts in C #. I know how to do this for a text box. I checked the process from Set value in a text box , but when I tried the same process for a text editor, it does not work, I want to get and set the value of the editor. please help me how can i do this.
to get the text of the text field:
IWebDriver firefoxDriver = new FirefoxDriver();
IWebElement passwordTextBox = Driver.FindElement(By.Id("passwordTextBox"));
passwordTextBox.Clear();
passwordTextBox.SendKeys("password");
I tried the code below to set the editor value
IWebElement detailFrame = driver.FindElement(By.CssSelector("#cke_1_contents .cke_wysiwyg_frame"));
driver.SwitchTo().Frame(detailFrame);
Thread.Sleep(1000);
var body = driver.FindElement(By.TagName("body"));
Thread.Sleep(1000);
body.SendKeys("<span>hiiiiiiii<span>");
source
share