Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在黄瓜测试用例中单击键盘的输入键。我使用了硒网络驱动程序。请告诉我该怎么做?
您可以使用键和ActionBuilder:
page.driver.browser.key_down(:enter).key_up(:enter).perform
或send_keys:
find(:id, 'my_id').native.send_keys(:enter)
Capybara 目前不包含自己的按键 API。