Selenium RC 和 WebDriver 之间有什么关系?

发布于 2024-09-16 13:00:46 字数 156 浏览 7 评论 0原文

可以看到从selenium 2.0开始,WebDriver和Selenium RC打包在一起供下载。现在我主要使用 WebDriver,但是我可以不时在我的测试脚本中引入 Selenium RC 吗?是否有什么是 Selenium RC 能够做到而 WebDriver 却不能做到的,或者反之亦然?

I can see that since selenium 2.0, WebDriver and Selenium RC are packaged together for download. Now I primarily use WebDriver, but can I bring in Selenium RC in my testing scripts from now and then? Is there anything that Selenium RC is capable of but WebDriver is not, or vice versa?

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

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

发布评论

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

评论(3

山有枢 2024-09-23 13:00:56

最大的区别是 RC 从 vs 运行,2.0 使用 Webdriver 并启动浏览器,而不是使用 vs。为了在 2.0 中运行 RC,请检查此处:http://seleniumhq.org/docs/09_webdriver.html#emulated-selenium-rc

我不知道如何将2.0带入RC ,但是你看到它们被包装在一起了吗?它们是两种不同的产品。 Selenium 2 是 webdriver,Selenium RC 是 Selenium 1。

就我个人而言,我发现 2.0 更容易编程。另外,到今年年底,Javascript 警报支持应该会实现,这是一个巨大的优势!

The biggest difference is RC runs from a vs, 2.0 uses Webdriver and launches the browser, instead of using a vs. In order to you RC in 2.0, check here: http://seleniumhq.org/docs/09_webdriver.html#emulating-selenium-rc

I dont know how to take 2.0 into RC though, but were do you see they are packaged together? They are two different products. Selenium 2 is webdriver, and Selenium RC is Selenium 1.

Personally, I found 2.0 a lot easier to program with. Plus by the end of the year Javascript alert support should be implemented, which is a huge plus!

椵侞 2024-09-23 13:00:54

我发现这是一个老问题,但发现这是在 Selenium HQ 主页上:

Selenium WebDriver 是 Selenium Remote Control 的继承者,
已被正式弃用。 Selenium 服务器(两者都使用)
WebDriver 和远程控制)现在还包括内置网格
能力。

就这么解决了:-)

I see this is an old question but found this is on the Selenium HQ home page:

Selenium WebDriver is the successor of Selenium Remote Control which
has been officially deprecated. The Selenium Server (used by both
WebDriver and Remote Control) now also includes built-in grid
capabilities.

So it's settled :-)

叹倦 2024-09-23 13:00:52

您可能应该从这里开始您的研究(尽管您可能已经研究过这一点): http://seleniumhq.org /docs/03_webdriver.html

我假设您将 Selenium-RC 与 WebDriver 进行对比,Selenium-IDE 确实不在同一个范围内。

Selenium 使用 JavaScript 来自动化网页。这使得它能够与 Web 内容进行非常紧密的交互,并且是最早支持 Ajax 和其他高度动态页面的自动化工具之一。然而,这也意味着 Selenium 在 JavaScript 沙箱内运行。这意味着您需要运行 Selenium-RC 服务器来绕过同源策略,这有时会导致浏览器设置出现问题。

另一方面,WebDriver 使用每种语言的本机自动化。虽然这意味着支持新的浏览器/语言需要更长的时间,但它确实提供了更接近浏览器的“感觉”。如果您对 WebDriver 感到满意,请坚持下去,它就是未来。目前存在一些限制和错误,但如果它们不能阻止您,那就继续吧。

Selenium 相对于 WebDriver 的优势

  • 支持多种浏览器和多种语言,WebDriver 需要每种新语言/浏览器组合的本机实现。
  • 非常成熟和完整的 API
  • 目前(2010 年 9 月)支持 JavaScript 警报并确认了更好的

WebDriver 与 Selenium 相比的优点

  • 原生自动化速度更快,并且不太容易出现错误和浏览器配置
  • 不需要 Selenium-RC Server正在运行
  • 访问 headless HTMLUnit 可以让测试运行得非常快
  • 很棒的 AP​​I

You should probably start your research here (though you may have already gone over this): http://seleniumhq.org/docs/03_webdriver.html

I'll assume you're contrasting Selenium-RC to WebDriver, Selenium-IDE really isn't in the same ballpark.

Selenium uses JavaScript to automate web pages. This lets it interact very tightly with web content, and was one of the first automation tools to support Ajax and other heavily dynamic pages. However, this also means Selenium runs inside the JavaScript sandbox. This means you need to run the Selenium-RC server to get around the same-origin policy, which can sometimes cause issues with browser setup.

WebDriver on the other hand uses native automation from each language. While this means it takes longer to support new browsers/languages, it does offer a much closer 'feel' to the browser. If you're happy with WebDriver, stick with it, it's the future. There are limitations and bugs right now, but if they're not stopping you, go for it.

Selenium Benefits over WebDriver

  • Supports many browsers and many languages, WebDriver needs native implementations for each new language/browser combo.
  • Very mature and complete API
  • Currently (Sept 2010) supports JavaScript alerts and confirms better

Benefits of WebDriver Compared to Selenium

  • Native automation faster and a little less prone to error and browser configuration
  • Does not require Selenium-RC Server to be running
  • Access to headless HTMLUnit can allow tests to run very fast
  • Great API
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文