Selenium Server 和 Selenium RC 有什么区别?

What is the difference between Selenium Server and Selenium RC?

Selenium Webdriver - 用于直接与浏览器交互

Selenium RC - 通过服务器与浏览器交互

如果我需要使用 Web-driver 进行远程测试,我需要使用 Selenium Server

  1. 所以当我们在第三点说Selenium Server时,是不是意味着 Selenium RC 使用相同的服务器?

  2. selenium RC 是否已经包含 selenium 服务器?如果需要用selenium RC做自动化,需要单独下载Selenium Server吗?

Selenium Remote Control (RC) 和 Selenium WebDriver 都是支持不同编程语言的测试自动化工具,但存在一些关键差异。


硒 RC

直到几年前 Selenium RC was an important component in the 测试套件。正是这个测试框架使 QA 或开发人员能够使用任何编程语言编写测试用例,以便针对任何 HTTP 网站自动对 Web 应用程序进行 UI 测试。 Selenium RC 由两部分组成:

  • 首选语言绑定艺术的客户端库。
  • 自动启动和销毁网络浏览器的服务器。

Selenium RC 的架构有点复杂:

  • Developer/QA 个人需要在 运行 测试脚本之前安装和启动名为 Selenium Remote Control Server 的单独应用程序。
  • Selenium RC 服务器充当浏览器和 Selenium 命令之间的中介。

执行顺序是:

  • Selenium RC 服务器将名为 Selenium Core 的 Javascript 程序注入浏览器客户端。
  • 注入Selenium Core程序后,它开始根据测试脚本从RC服务器接收指令。 Selenium Core 将所有这些指令作为 JavaScript 命令执行。
  • Web 浏览器执行了 Selenium Core 给出的所有命令,并且returns将测试摘要返回给 Selenium RC 服务器。

但有如下限制:

  • Selenium RC Server 的架构相当复杂。
  • 测试脚本的执行非常耗时,因为 Selenium RC 使用 JavaScript 命令作为浏览器的指令,导致性能下降。
  • API 不太面向对象。
  • 不支持无头浏览器。

Selenium RC Server 的所有这些限制导致了新的强大自动化框架的开发


WebDriver

从 Selenium 的角度来看,WebDriver 接口类似于 Mozilla、Chrome、Internet Explorer、Safari 等第三方浏览器供应商必须遵守和实施的协议。这反过来会帮助最终用户使用公开的 API 编写通用代码并在所有可用浏览器中实现功能,而无需任何更改。


这个用例

要执行您的测试用例:

  • Locally:Selenium 客户端(罐子)是一堆 API 可以满足您的需要。
  • 在远程机器上(Selenium Grid):Selenium Server 可以解决您的问题。

You can find a relevant discussion in