Selenium 和 HTTPUnit

发布于 2024-11-16 12:58:13 字数 56 浏览 6 评论 0原文

两者的优缺点是什么?为什么我应该使用它们中的任何一个进行功能测试?

问候, 乔纳斯

What's the pro's and cons for both and why should I use either of them for functional testing?

Regards,
Jonas

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

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

发布评论

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

评论(3

烙印 2024-11-23 12:58:13

Selenium 用于集成测试,它将测试您的 Web 应用程序在实际浏览器中的行为方式。这可以找到 HTTPUnit 无法找到的东西,例如 css 和 JavaScript 的浏览器兼容性。

HTTPUnit 通过直接调用 Web 服务并操作响应来测试 Web 应用程序。这是一个功能测试框架,因为它测试您的 Web 应用程序的功能,而不是它在不同平台上的行为方式。

HTTPUnit 的优点之一是它比 Selenium 快得多。就我个人而言,我会(并且确实)同时使用两者。 HTTPUnit 用于完整的功能测试,Selenium 用于选择性(非完整)集成测试以检查浏览器兼容性。

Selenium is for integration testing, It will test how your web application behaves in an actual browser. This can find things that HTTPUnit cannot, e.g. browser compatibility of css and JavaScript.

HTTPUnit tests web applications by directly calling the web service and manipulating the response. This is a functional test framework as it tests what your web app does, not how it behaves across different platforms.

One advantage of HTTPUnit is that it is much quicker than Selenium. Personally I would (and do) use both. HTTPUnit for complete functional testing and Selenium for selective (not complete) integration testing to check browser compatibility.

深空失忆 2024-11-23 12:58:13

HttpUnit 非常简单,非常易于使用,并且只需要很少的时间即可启动和运行。对于简单的测试来说,这是一个很好的起点,但是它需要更多的编码来创建复杂的测试。

Selenium 不仅仅是一个库,就像 HttpUnit 一样。它可以帮助您更好地进行更高级、有状态的测试。

HttpUnit is very simple, extremely easy to use, and requires very little to get up and running. It's a good place to start for simple tests, however it will require more coding to create complex tests.

Selenium is more than just a library, like HttpUnit. It equips you better for more advanced, stateful tests.

像极了他 2024-11-23 12:58:13

Selenium 将使用您的浏览器来自动化测试
- Selenium http://seleniumhq.org/

httpunit 来自 html 规范并模拟符合标准的浏览器
- httpunit http://httpunit.sourceforge.net/

Selenium 更具体,可以让您使用浏览器特定的行为并且不限制被测应用程序。

对于 httpunit,限制是由 httpunit 支持的内容设置的,这远远低于大多数浏览器的支持。例如,JavaScript 功能被缩减为非常小的集合。另一方面,如果您的应用程序通过了 httpunit 测试,它可能会在相当多的浏览器和环境上运行。

因此,如果您有兴趣支持一组最小的通用功能,httpunit 可能适合您。

Selenium will use your browser to automate tests
- Selenium http://seleniumhq.org/

httpunit goes from the html specification and simulates a standards conformant browser
- httpunit http://httpunit.sourceforge.net/

Selenium is more specific and will let you use browser specific behaviour and not limit the application under test.

With httpunit the limits are set by what httpunit supports which is far less than most browser do. E.g. the javascript capabilities are reduced to a very small set. On the other hand if your app passes httpunit tests it will probably run on quite a few browsers and environments.

So if you are interested in supporting a mininimal common set of features httpunit might be for you.

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