selenium-google-code-issue-archive icon indicating copy to clipboard operation
selenium-google-code-issue-archive copied to clipboard

send_keys to an element nested inside contenteditable element doesn't actually send keys

Open lukeis opened this issue 8 years ago • 2 comments

Originally reported on Google Code with ID 7651

Run the following script (Ruby):


require 'selenium-webdriver'
require 'minitest/autorun'

class TestContentEditable < MiniTest::Unit::TestCase
  def setup
    @driver = Selenium::WebDriver.for :firefox
    @driver.get 'http://www.sceditor.com/'
    iframe = @driver.find_element(:css, '.sceditor-container > iframe')
    @driver.switch_to.frame(iframe)
  end

  def test_sending_keys_to_body
    el = @driver.find_element(:css, 'body')
    el.send_keys 'SOME TEXT'
    assert_includes el.text, 'SOME TEXT'
  end

  def test_sending_keys_to_nested_element
    el = @driver.find_element(:css, 'div')
    el.send_keys 'SOME TEXT'
    assert_includes el.text, 'SOME TEXT'
  end

  def teardown
    @driver.quit
  end
end


The first test passes but the second test fails. I would expect second to pass and
the keys sent to that element (i.e. to a place where "SCEditor" is shown).

Selenium version: 2.42
OS: Ubuntu 14.04
Browser: Firefox 30.0

Reported by botalov.andrey on 2014-07-24 18:11:50

lukeis avatar Mar 04 '16 08:03 lukeis

Reported by barancev on 2014-07-25 07:36:39

  • Labels added: Browser-Firefox

lukeis avatar Mar 04 '16 08:03 lukeis

Reported by luke.semerau on 2015-09-17 17:47:04

  • Labels added: Restrict-AddIssueComment-Commit

lukeis avatar Mar 04 '16 08:03 lukeis