用于测试 Rails 和 Merb 应用程序的 selenium 和 watir 的无头替换

发布于 2024-08-02 08:28:25 字数 503 浏览 4 评论 0原文

未来是否有计划用 mechanize + johnson 取代 selenium 和 watir?

https://github.com/jbarnette/johnson/wiki

< /a>http://wiki.github.com/tenderlove/mechanize

Are there any future plans to replace selenium and watir with mechanize + johnson?

https://github.com/jbarnette/johnson/wiki

http://wiki.github.com/tenderlove/mechanize

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小傻瓜 2024-08-09 08:28:25

目前,似乎最有动力的是 celerity,它是“orip”提到的围绕 HtmlUnit 的 Jruby 包装器。

此外,还有一个围绕 celerity 的非常简洁的包装器“culerity”,它允许您访问 HtmlUnit(运行 Java/JRuby)您的正常机器设置。 Culerity 是 Cucumber 和 Celerity 之间的桥梁。

这对于用 Cucumber 编写测试来说非常有用,我强烈推荐它。

以下是更多信息:

http://drogomir .com/blog/2009/6/16/cucumber-and-celerity-testing-unobtrusive-javascript

以下是错误示例:
http://github.com/drogus/culerity-javascript-example/tree/ master

这是 culerity 项目本身,也有很好的例子(以及一个很好的安装指南)
http://github.com/langalex/culerity/tree/master

关于此设置的成熟度:
几周前我尝试过这个。我很容易就得到了 culity 示例并运行起来。

另一方面,我在两件事上遇到了问题:

  • 我希望它通过 Webrat 访问我的本地 Rails 应用程序,但遇到了问题——(Webrat 的 culerity 接口在撰写本文时还不够成熟)。
  • 该方法似乎比通过 Selenium(启动常规浏览器)运行类似测试慢得多。在我的示例中,selenium 测试比 culerity 测试大约快 3-4 倍。

我的一些发现可能是在极端前沿进行尝试的结果。然而,我仍然认为这将是这样,无头浏览器测试将会进行,除了不成熟的 webrat/culerity 界面之外,您可能可以创建一些基于 celerity/HtmlUnit 的不错的测试套件:)

我希望这能回答您的问题。

For the moment, there seems to be most momentum around celerity which is a Jruby wrapper around HtmlUnit mentioned by "orip"

Also there is a pretty neat wrapper "culerity" around celerity, which allows you to access HtmlUnit (running Java/JRuby) in your normal machine setup. Culerity is the bridge between Cucumber and Celerity.

This is brilliant for writing tests in Cucumber, which i can highly recommend.

Here is more info:

http://drogomir.com/blog/2009/6/16/cucumber-and-celerity-testing-unobtrusive-javascript

And here is the culerity examples:
http://github.com/drogus/culerity-javascript-example/tree/master

Here is the culerity project itself also with good examples (and a nice install guide)
http://github.com/langalex/culerity/tree/master

A note on maturity of this setup:
I experimented with this a couple of weeks ago. And i got the culerity examples up and running fairly easy.

On the other hand, I had problems with two things:

  • I wanted it to access my local Rails app via Webrat and ran into problems with that -- (The culerity interface to Webrat is not mature enough as of time writing).
  • The approach seemed much slower than running similar tests via Selenium (which starts a regular browser). In my example, the selenium test was about 3-4 times faster than a culerity test.

Some of my findings may be a result of trying this out on the extreme bleeding edge. However, i still think that this will be the way, the headless browser tests will go, and apart from the immature webrat/culerity interface, you could probably create some decent test suite based on celerity/HtmlUnit :)

I hope this answers your question.

∞觅青森が 2024-08-09 08:28:25

有点离题,但您已经可以使用 HtmlUnit 来支持 JS 的无头浏览器,以进行测试。使用 JRuby,您甚至可以继续使用 Ruby。

A little off-topic, but you can already use HtmlUnit for a JS-supporting headless browser geared for testing. Using JRuby you can even keep using Ruby.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文