Selenium 还是 WebDriver api?

发布于 2024-11-17 10:52:33 字数 227 浏览 1 评论 0原文

我将开始使用 JBehave Web 为 Web 应用程序创建测试,我一直在检查,发现除了 Selenium 的原始 API 之外,Selenium 现在还集成了 WebDriver api。

我的问题是,我应该使用哪一个?该应用程序需要在 Firefox 和 Internet Explorer 上进行测试,并具有一些 Ajax 功能(尽管没有太复杂)。

此外,任何对一些好的教程或书籍的参考都将不胜感激!

I will start using JBehave Web to create tests for a web applications, I've been checking and I saw that Selenium now integrates WebDriver api besides the original one from Selenium.

My question is, which one should I use? The application needs to be tested on Firefox and Internet Explorer and has some Ajax functionalities (although nothing too complex)

Also any reference to some good tutorial or book would be greatly appreciated!

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

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

发布评论

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

评论(3

究竟谁懂我的在乎 2024-11-24 10:52:33

旧的 Selenium (1.0) API 不再真正被开发,现在 Selenium 2.0 中的一切都是关于 WebDriver 的。我推荐它是为了让您的代码面向未来。

The old Selenium (1.0) API is not really being developed any more, it's all about WebDriver now in Selenium 2.0. I recommend it for future-proofing your code.

甜中书 2024-11-24 10:52:33

使用您感觉更舒服的任何一个。 WebDriver API 最近才在 Selenium 2.0RC3 中稳定下来,而 Selenium RC API 至少在一年内没有发生任何变化。 artbristol 是对的,RC API(他称之为 1.0)没有得到进一步开发,但它也不会很快消失。

说到书,有两本非常好。这两本都是很棒的 Selenium 初学者书籍,内容也很丰富。两者都有平装本和电子书形式。如果您想查看它们,作者或其出版商都提供免费的部分下载。电子书的价格非常合理,平装书的价格也很有竞争力。

Use whichever you feel more comfortable with. The WebDriver API has only recently settled down in Selenium 2.0RC3, while the Selenium RC API hasn't been changed at all in at least a year. artbristol is right that the RC API (what he calls 1.0) isn't being developed further, but it's not going away any time soon either.

As to books, there are two very good ones. Both are great beginner’s books for Selenium and a great deal . Both are available in paperback and as e-books. And if you want to peek at them, both authors or their publishers offer partial downloads for free. The e-book prices are very reasonable, and the paperback prices are competitive.

笙痞 2024-11-24 10:52:33

据我所知,由于两个项目(selenium 和 webdriver)合并,底层基础设施是相同的。因此,您不应该通过使用一种 API 而不是另一种来提高速度。您应该使用您最喜欢的 API。

我的观点是 webdriver API 更方便。使用对象而不是编写过程代码要方便得多。它缩短了您的 xpath 并使代码更简单、更优雅。另外,当您经常使用对象时,编写页面对象会更容易。

As far as I know, since the two projects (selenium and webdriver) are merged, the underlying infrastructure is the same. So you shouldn't gain speed by using one API instead of another. You should use the API you like most.

My opinion is that the webdriver API is more convenient. It's much more convenient to use objects and not write procedural code. It shortens your xpaths and makes code easier and much more elegant. Plus, it's easier to write page objects when your working constantly with objects.

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