Hi everyone,
I've successfully used WebDriver for quite some time, yet now I'm
running into a unsolvable problem for me.
I try to test my comments page component which is created from the JSF
library RichFaces (<rich:editor>) which facilitates TinyMCE to do the
job.
I can't seem to get WebDriver to set any value to the WYSIWYG editor
field. Here is the rendered HTML part:
==============
<div id="commentForm:j_id362:commentInput" class="rich-editor">
<textarea id="commentForm:j_id362:commentInputTextArea"
style="visibility: hidden; display: none;"
name="commentForm:j_id362:commentInputTextArea"/>
<span id="commentForm:j_id362:commentInputTextArea_container"
class="mceEditor richfacesSimpleSkin">
<table class="mceLayout" cellspacing="0" cellpadding="0"
style="width: 811px; height: 106px;">
<tbody>
<tr>
<td>
<div class="mceIframeContainer">
<iframe
id="commentForm:j_id362:commentInputTextArea_ifr" frameborder="0"
src="javascript:""" style="width: 100%; height: 100px;">
<html>
<head>
<!-- Loading some CSS -->
</head>
<body id="tinymce" class="mceContentBody"
spellcheck="false" dir="ltr">
<p>
<br mce_bogus="1"/>
</p>
</body>
</html>
</iframe>
</div>
</td>
</tr>
<tr class="last">
<td class="mceToolbar mceLast" align="center">
</td>
</tr>
</tbody>
</table>
</span>
<!-- loading some JS -->
</div>
================
When I try to clear/sendKeys to 'commentInput' is (correctly) says it
can't find an input/textarea and when I use 'commentInputTextArea' it
throws:
================
org.openqa.selenium.ElementNotVisibleException: Element is not
visible, and so cannot be interacted with
System info:
os.name: 'Linux', os.arch: 'amd64', os.version:
'2.6.27.21-170.2.56.fc10.x86_64', java.version: '1.6.0_13'
Driver info: driver.version: firefox
at org.openqa.selenium.firefox.Response.ifNecessaryThrow
(Response.java:94)
at org.openqa.selenium.firefox.FirefoxDriver.sendMessage
(FirefoxDriver.java:284)
at org.openqa.selenium.firefox.FirefoxWebElement.sendMessage
(FirefoxWebElement.java:270)
at org.openqa.selenium.firefox.FirefoxWebElement.sendKeys
(FirefoxWebElement.java:78)
at com.sunshock.portal.test.ui.api.WebComponent.set(WebComponent.java:
442)
at com.sunshock.portal.test.ui.api.WebComponent.set(WebComponent.java:
169)
================
Any ideas?