selenium - Selenium RC 和 WebDriver 之间的区别

标签 selenium selenium-webdriver selenium-rc

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

最佳答案

引用自WebDriver and Selenium RC :

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.

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.

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.

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

  • 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 - Selenium RC 和 WebDriver 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11535950/

相关文章:

selenium - href 元素的 Xpath

python - 索引错误 : list index out of range in python while something not found

selenium - count(*)> xpath 构建中的表达式

python - 查找页面上文本的部分内容,然后使用 Selenium 在 Python 中返回该 <div> 的完整内容

python - Selenium 文件上传使文件选择器窗口保持打开状态(OS/X 和 Python)

selenium - 要针对 Internet Explorer 运行 Selenium 测试,Selenium-RC 本身是否必须位于 WIndows 服务器上?

javascript - 有什么方法可以自动处理 firefox/IE 中抛出的 javascript 错误

xml - 生成 JUnit 报告使用的 XML 文件

java - 检查类中是否存在 ng-hide

java - Selenium 中的断言