如何从 ruby 文件在已打开的浏览器上执行命令 [英] How do I execute a command on already opened browser from a ruby file
问题描述
我使用 Cucumber 框架来测试 Web 应用程序,当我开发我的脚本时,每次在我的代码中添加一些内容后,我都必须一次又一次地启动浏览器.我的问题是是否可以从 ruby(.rb) 文件在已打开的浏览器上执行命令"??.这将节省我很多时间.我的框架基于 cucumber、capybara 和 selenium webdriver.
I use cucumber framework for testing web application, as i develop my scripts i have to launch the browser again and again every time after adding something to my code. My question is "Is it possible to execute a command on already opened browser from a ruby(.rb ) file" ??. Which will save me a lot of time . My framework is based on cucumber, capybara and selenium webdriver.
提前致谢
推荐答案
无法将现有浏览器与 Selenium Webdriver 一起使用.
但是,与浏览器相比,有些驱动程序(Capybara-Webkit、Poltergeist、Webdriver 的 HtmlUnitDriver)更快且启动时间更短.也许,它们会对你有好处.
However, there drivers (Capybara-Webkit, Poltergeist, Webdriver's HtmlUnitDriver) that are faster and have less startup time than browsers. Maybe, they will be good for you.
这篇关于如何从 ruby 文件在已打开的浏览器上执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!