简体   繁体   English

如何使用Capybara和Selenium Web驱动程序发送密钥

[英]How do I send keys using Capybara with selenium web driver

I know capybara uses native, do I need to install a gem for this? 我知道水豚使用本机,是否需要为此安装宝石?

I am trying to press enter after typing in a search box 我想在输入搜索框后按Enter

If using capybara 2.5 you can do 如果使用水豚2.5,则可以

input = find_field 'id, name, label of search box'
input.send_keys 'text to send', :enter

If using capybara < 2.5 with selenium it would be 如果将水豚<2.5与硒一起使用

input.native.send_keys 'text to send', :enter

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在水豚中向键发送向下箭头 - How do I send_keys a down arrow in capybara 如果定义了Capybara Poltergeist驱动程序(对于Ruby),如何访问Selenium方法 - How to access Selenium methods if I defined Capybara Poltergeist driver (for Ruby) 如何使用Ruby调用定义的Capybara驱动程序的Selenium方法? - How to call Selenium methods with defined Capybara driver using Ruby? 如何在使用 Webdrivers gem 时向 Capybara 注册 IEDriver 和 Edge Driver? - How do I register IEDriver and Edge Driver with Capybara while using the Webdrivers gem? 在rspec / capybara测试中使用:selenium Web驱动程序检查标题时出错 - Error while checking for headers using :selenium web driver in rspec/capybara test 如何单击文本区域以使用Selenium Web驱动程序使用ruby发送长文本 - how to click on text area to send long text using ruby with selenium web driver 如何使用Selenium webdriver在Capybara中打开一个新窗口? - How do I open a new window in Capybara with Selenium webdriver? 如何从Capybara元素中提取硒元素? - How do I extract the Selenium Element from a Capybara Element? 如何使用红宝石水豚/硒访问复选框 - How do I access a checkbox with ruby capybara/selenium 使用Cucumber和Selenium / Capybara从简单的自动化过渡到Page Object Model框架时,我需要做多少工作? - How much rework do i have to do when moving from simple automation to Page Object Model framework using Cucumber and Selenium/Capybara?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM