Issue 2331 in selenium: sendKeys doesn't work on BODY element with contentEditable=true

103 views
Skip to first unread message

sele...@googlecode.com

unread,
Aug 24, 2011, 1:11:05 PM8/24/11
to selenium-deve...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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

sele...@googlecode.com

unread,
Aug 25, 2011, 4:32:17 AM8/25/11
to selenium-deve...@googlegroups.com

Comment #1 on 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

Still present in Selenium 2.5.0.

sele...@googlecode.com

unread,
Aug 26, 2011, 9:10:44 AM8/26/11
to selenium-deve...@googlegroups.com

Comment #2 on issue 2331 by vmas...@gmail.com: sendKeys doesn't work on
BODY element with contentEditable=true
http://code.google.com/p/selenium/issues/detail?id=2331

Note that this used to work in older versions of Selenium2 and has started
to fail recently (can't give exact versions).

sele...@googlecode.com

unread,
Oct 7, 2011, 9:03:27 AM10/7/11
to selenium-deve...@googlegroups.com

Comment #3 on issue 2331 by vmas...@gmail.com: sendKeys doesn't work on
BODY element with contentEditable=true
http://code.google.com/p/selenium/issues/detail?id=2331

Still doesn't work on Selenium 2.8.0... guys could you do something about
this? Thanks

sele...@googlecode.com

unread,
Oct 13, 2011, 5:19:32 AM10/13/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Component-WebDriver

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.)

sele...@googlecode.com

unread,
Nov 18, 2011, 1:15:12 PM11/18/11
to selenium-deve...@googlegroups.com

Comment #5 on issue 2331 by vinc...@xwiki.com: sendKeys doesn't work on
BODY element with contentEditable=true
http://code.google.com/p/selenium/issues/detail?id=2331

Still not working on 2.12.0....

Reply all
Reply to author
Forward
0 new messages