Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to click enter key with cucumber test cases

I need to click enter key of keyboard in cucumber test cases. I have used selenium web-driver. Please tell me how to do it?

like image 302
vijay chouhan Avatar asked Feb 10 '13 18:02

vijay chouhan


1 Answers

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 doesn't currently contain its own API for pressing keys.

like image 159
Andrei Botalov Avatar answered Nov 10 '22 00:11

Andrei Botalov