Selenium IDE、Selenium RC 和 Selenium WebDriver 有什么区别?

What is the difference between Selenium IDE, Selenium RC and Selenium WebDriver?

Selenium IDE、Selenium RC 和 Selenium WebDriver 有什么区别;我们可以在什么样的项目中使用它们?任何建议将不胜感激。

Selenium IDE 是一个 Firefox 或 Chrome 插件,允许您记录和 运行 您 运行 使用 Firefox 的测试。您不能在 IDE 中执行高级测试策略,例如多次循环单个操作等,因为您不能使用任何编程语言来编写测试用例。

Selenium RC 和 WebDriver 允许您选择您感兴趣的语言来编写测试用例。在 Selenium RC 或 WebDriver 的帮助下,您几乎可以执行任何类型的手动操作。 RC 和 WebDriver 之间的主要区别在于,RC 使用远程控制将您的测试转换为浏览器本机代码,您的测试与远程控制交互,远程控制与浏览器交互,而 WebDriver 直接与浏览器交互而无需任何远程服务器,所以执行速度更快。

我在某处读到 RC 将用某种编程语言编写的测试用例转换为 Javascript 函数(可以控制浏览器),而 Web 驱动程序直接通过 HTTP 命令与浏览器通信。

Selenium RC 已弃用,人们正在使用 WebDriver 而不是 RC。

根据 Choosing Your Selenium Tool 的官方文档:

Many people get started with Selenium IDE. If you are not already experienced with a programming or scripting language you can use Selenium IDE to get familiar with Selenium commands. Using the IDE you can create simple tests quickly, sometimes within seconds.

We don’t, however, recommend you do all your test automation using Selenium IDE. To effectively use Selenium you will need to build and run your tests using either Selenium 2 or Selenium 1 in conjunction with one of the supported programming languages. Which one you choose depends on you.

At the time of writing the Selenium developers are planning on the Selenium-WebDriver API being the future direction for Selenium. Selenium 1 is provided for backwards compatibility. (...).

(...) However, for those who are adopting Selenium for the first time, and therefore building a new test suite from scratch, you will probably want to go with Selenium 2 since this is the portion of Selenium that will continue to be supported in the future.

同样来自文档,请注意 Selenium 1 is also known as Selenium RC or Remote Control and Selenium 2 is also known as Selenium WebDriver

Selenium 是一个开源项目,可以阅读更多详细信息here

Selenium IDE 是一个浏览器插件(目前仅适用于 Chrome 和 Firefox)。如果想要编写网站交互(如快速错误再现)的脚本,它很容易使用。问题是,它创建了非常脆弱的测试,会破坏很多。

Selenium WebDriver is a programmatic package that drives a browser natively. It's meant to help develop automation that interacts with, primarily, with the frontend of websites. Other tools, like Nightwatch.js,作为核心

两者之间存在差异:Selenium IDE 适合制作这些探索性脚本,而 Selenium WebDriver 是进行实际生产就绪系统测试的一种方式。

硒IDE 这个可以通过browser(Chrome, firefox)插件来使用,我只是用来录制和播放测试用例。 Selenium套件的基础项目之一。

优点: 无需编码技能。

缺点: 只能测试快乐路径测试用例,因为不能使用任何循环来回做。

硒 RC 创建了充当 HTTP 代理服务器的服务器,以欺骗浏览器和应用程序相信它们都来自同一个域,也称为 Selenium 1,这里需要编码知识来编写测试用例。

优点: 处理同源策略[通过创建的服务器]

缺点: 服务器解决方案本身就是一个问题,因为人们总是需要在本地计算机上使用该服务器来通过 Selenium RC 进行测试。

Selenium WebDriver 这是上述问题的解决方案,因为它直接与 OS 级别的浏览器通信。不需要任何服务器,代码可以直接与浏览器交互。