Selenium RC 和 WebDriver 之间有什么关系?
可以看到从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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最大的区别是 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!
我发现这是一个老问题,但发现这是在 Selenium HQ 主页上:
就这么解决了:-)
I see this is an old question but found this is on the Selenium HQ home page:
So it's settled :-)
您可能应该从这里开始您的研究(尽管您可能已经研究过这一点): 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 与 Selenium 相比的优点
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
Benefits of WebDriver Compared to Selenium