Selenium RC和WebDriver之间的区别 [英] Difference between Selenium RC and WebDriver

查看:209
本文介绍了Selenium RC和WebDriver之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Selenium RCWebDriver之间的基本区别是什么?

What's the basic difference between Selenium RC and WebDriver?

推荐答案

引用自 WebDriver和Selenium RC :

Selenium-WebDriver使用每个浏览器的本机自动化支持直接调用浏览器.这些直接调用的方式以及它们支持的功能取决于您使用的浏览器.本章稍后将提供有关每个浏览器驱动程序"的信息.

Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. How these direct calls are made, and the features they support depends on the browser you are using. Information on each ‘browser driver’ is provided later in this chapter.

对于那些熟悉Selenium-RC的人来说,这与您习惯的完全不同. Selenium-RC对于每种受支持的浏览器都以相同的方式工作.加载浏览器时,它将"JavaScript"功能注入"浏览器,然后使用其JavaScript在浏览器中驱动AUT. WebDriver不使用此技术.再次,它使用浏览器内置的自动化支持直接驱动浏览器.

For those familiar with Selenium-RC, this is quite different from what you are used to. Selenium-RC worked the same way for each supported browser. It ‘injected’ javascript functions into the browser when the browser was loaded and then used its javascript to drive the AUT within the browser. WebDriver does not use this technique. Again, it drives the browser directly using the browser’s built in support for automation.

根据您打算如何使用Selenium-WebDriver,您可能需要Selenium服务器,也可能不需要.如果仅使用WebDriver API,则不需要Selenium服务器.如果您的浏览器和测试都将在同一台计算机上运行,​​并且您的测试仅使用WebDriver API,则无需运行Selenium-Server;否则,您将无法运行Selenium-Server. WebDriver将直接运行浏览器.

You may, or may not, need the Selenium Server, depending on how you intend to use Selenium-WebDriver. If you will be only using the WebDriver API you do not need the Selenium-Server. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly.

出于某些原因,可以将Selenium-Server与Selenium-WebDriver一起使用.

There are some reasons though to use the Selenium-Server with Selenium-WebDriver.

  • 您正在使用Selenium-Grid在多个计算机或虚拟机(VM)上分布测试.
  • 您要连接到具有特定浏览器版本而不是当前计算机上的远程计算机.
  • 您没有使用Java绑定(即Python,C#或Ruby),而是想使用HtmlUnit驱动程序.
  • You are using Selenium-Grid to distribute your tests over multiple machines or virtual machines (VMs).
  • You want to connect to a remote machine that has a particular browser version that is not on your current machine.
  • You are not using the Java bindings (i.e. Python, C#, or Ruby) and would like to use HtmlUnit Driver.

这篇关于Selenium RC和WebDriver之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆