开发者

How to easily switch between Webrat and Selenium?

Please let me know how can I easily switch between Webrat and Selinium? Selinium takes longer as it simulates by opening the real browser. In some cases I do not need this and just W开发者_如何转开发ebrat, showing results in command line is just fine and faster. Is there anyway to configure cucumber to switch between Webrat and Selenium??


There are a number of ways to accomplish this. But the easiest is:

Tag individual files/Scenarios with @selenium to invoke selenium and then use @javascript as your default driver which uses webrat as the default driver, if I recall correctly.

This will only call Selenium when you invoke it directly.


Capybara is designed to be a webrat replacement, and it supports multiple back-end drivers (including Selenium) and you can switch between them, even during a test run. For example, maybe you want most of your tests to run fast but some require ajax testing / cross-browser testing and for those you can switch to Selenium.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜