Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 没有这样的键:从Poltergeist迁移到Selenium后输入_Ruby On Rails 4_Selenium Webdriver_Rspec_Capybara_Selenium Chromedriver - Fatal编程技术网

Ruby on rails 4 没有这样的键:从Poltergeist迁移到Selenium后输入

Ruby on rails 4 没有这样的键:从Poltergeist迁移到Selenium后输入,ruby-on-rails-4,selenium-webdriver,rspec,capybara,selenium-chromedriver,Ruby On Rails 4,Selenium Webdriver,Rspec,Capybara,Selenium Chromedriver,在从Poltergeist迁移到Selenium WebDriver/ChromeDriver之后,试图让规范通过一个旧的Rails 4项目。.native.send_键(:Enter) 是否有一个等效的或最佳的做法,我们应该切换到 17) Comment creation for image changes counter Failure/Error: find('input[name="comment[body]"]').native.send_key(:Enter) Sele

在从Poltergeist迁移到Selenium WebDriver/ChromeDriver之后,试图让规范通过一个旧的Rails 4项目。
.native.send_键(:Enter)

是否有一个等效的或最佳的做法,我们应该切换到

  17) Comment creation for image changes counter
  Failure/Error: find('input[name="comment[body]"]').native.send_key(:Enter)

  Selenium::WebDriver::Error::UnsupportedOperationError:
    no such key :Enter
  # ./spec/support/helpers/comments_page_helpers.rb:13:in `add_comment'
  # ./spec/features/comments/creation_spec.rb:72:in `block (4 levels) in <top (required)>'
  # ./spec/features/comments/creation_spec.rb:71:in `block (3 levels) in <top (required)>'
#spec/support/helpers/comments\u page\u helpers.rb


如果您需要发送enter键,则不应在
native
上调用任何内容,并且应使用小写字母作为符号,这样就可以使用Poltergeist或Selenium作为驱动程序

find('input[name="comment[body]"]').send_keys(:enter)

请参见

如果需要发送enter键,则不应在
本机
上调用任何内容,并且应使用小写字母作为符号,然后使用Poltergeist或Selenium作为驱动程序

find('input[name="comment[body]"]').send_keys(:enter)

find('input[name="comment[body]"]').send_keys(:enter)