0

I'm trying to call .send_keys on a Capybara element I retrieved using a siteprism page model.

Relevant section of page model:

class SearchPage < SitePrism::Page
  element :omnisearch_input, "input.db-search__input"

In the rails console I can run:

@search_page.omnisearch_input

# And then I get:
<Capybara::Element tag="input" path="//HTML[1]/BODY[1]/DIV[1]/SECTION[1]/SECTION[1]/DIV[1]/INPUT[1]">

Which to me means I've got a Capybara element, which is exactly what the documentation says I can call .send_keys on. But when I run:

@search_page.omnisearch_input.send_keys "some text"
# Result:
NoMethodError: undefined method `send_keys' for #<Capybara::Node::Element:0x007f9effbaaef0>

To further enforce this I can call .set "some text" on the same element without any trouble. What am I missing?

James
  • 25
  • 1
  • 6

1 Answers1

1

Capybara 2.4.4 is 2.5 years old, and send_keys was added to Element in 2.5.0 - https://github.com/teamcapybara/capybara/blob/master/History.md#version-250

You need to update all of the mentioned gems.

Thomas Walpole
  • 48,548
  • 5
  • 64
  • 78