How to press enter with cucumber tests

I need to press the keyboard enter key in the cucumber tests. I used the selenium web driver. Please tell me how to do this?

+5
source share
1 answer

You can use keys and ActionBuilder :

page.driver.browser.key_down(:enter).key_up(:enter).perform

or send_keys :

find(:id, 'my_id').native.send_keys(:enter)

Capybara does not currently have its own keystroke API.

+8
source

All Articles