SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
347 stars 195 forks source link

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

Open lukeis opened 8 years ago

lukeis commented 8 years ago

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 commented 8 years ago

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

lukeis commented 8 years ago

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