Here is the original code snippet:
I am having trouble entering text in the text box below. Can you please help me figure out how to enter text in this text box?
<td id="ctl00_cRight_ucSMS_redSMSBodyCenter" class="reContentCell" style="height:100%;">
<label for="ctl00_cRight_ucSMS_redSMSBodyContentHiddenTextarea" style="display:none;">
RadEditor hidden textarea
</label>
<textarea id="ctl00_cRight_ucSMS_redSMSBodyContentHiddenTextarea" name="ctl00$cRight$ucSMS$redSMSBody" rows="4" cols="20" style="display:none;">
</textarea>
<iframe frameborder="0" src="javascript:'<html></html>';id="ctl00_cRight_ucSMS_redSMSBody_contentIframe" title="Rich text editor with ID ctl00_cRight_ucSMS_redSMSBody" style="width: 100%; height: 218.009px; margin: 0px; padding: 0px;">
</iframe></td>
I have tried using the following code snippet to enter data:
IWebElement userid = FamosDriver.WebDriver.FindElement(By.Id("ctl00_cRight_ucSMS_redSMSBodyCenter"));
userid.SendKeys("Test");
I have also attempted to use the following JavaScript executor code:
IJavaScriptExecutor jst = FamosDriver.WebDriver as IJavaScriptExecutor;
jst.executeScript("document.getElementById('ctl00_cRight_ucSMS_redSMSBodyCenter').value='testuser'");
Is there something I am missing? I'm not sure how to resolve this issue.