New issue 2331 by mariusdu...@xwiki.com: sendKeys doesn't work on BODY
element with contentEditable=true
http://code.google.com/p/selenium/issues/detail?id=2331
What steps will reproduce the problem?
Use these two tests:
@Before
public void setUp()
{
getDriver().get("url/to/html/test/page");
getDriver().switchTo().frame("rta");
executeScript("document.body.innerHTML = '<div>1</div>';");
}
@Test
public void testBody()
{
executeScript("document.body.contentEditable = true;");
WebElement body = getDriver().findElement(By.xpath("//body"));
body.sendKeys("2");
Assert.assertEquals("12", body.getText());
getDriver().switchTo().defaultContent();
}
@Test
public void testDiv()
{
executeScript("document.body.firstChild.contentEditable = true;");
WebElement div = getDriver().findElement(By.xpath("//div"));
div.sendKeys("2");
Assert.assertEquals("12", div.getText());
getDriver().switchTo().defaultContent();
}
The HTML test page contains:
<iframe id="rta"></iframe>
What is the expected output? What do you see instead?
testBody() fails and testDiv() passes. sendKeys() has the expected behavior
when called on a DIV element with contentEditable=true, but is ignored when
called on a BODY element with contentEditable=true.
Selenium version: 2.4.0
OS: Ubuntu 11.04 x86_64 (Linux 2.6.38-11-generic)
Browser: Firefox
Browser version: 6.0
Still present in Selenium 2.5.0.
Note that this used to work in older versions of Selenium2 and has started
to fail recently (can't give exact versions).
Still doesn't work on Selenium 2.8.0... guys could you do something about
this? Thanks
Comment #4 on issue 2331 by barancev: sendKeys doesn't work on BODY element
with contentEditable=true
http://code.google.com/p/selenium/issues/detail?id=2331
(No comment was entered for this change.)
Still not working on 2.12.0....