什么是 Selenium,什么是 WebDriver? [英] What Is Selenium And What Is WebDriver?

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

问题描述

什么是硒?

打开Selenium的官方页面,首先看到的是什么是Selenium?"中的Selenium自动化浏览器".部分.Selenium 的哪个部分适合我?"部分下面提供了 Selenium WebDriver 和 Selenium IDE 之间的选择.由此推断Selenium是一个工具集合,集合包括IDE、WebDriver API(语言绑定)、Grid、Selenium Standalone Server、浏览器驱动.一个人必须下载合适的来构建一个项目.

When you open the official page of the Selenium, the first thing you read is "Selenium automates browser" in "What is Selenium?" section. The section "Which part of Selenium is appropriate for me?" below offers the choice between Selenium WebDriver and Selenium IDE. From this, I deduce that Selenium is a collection of tools and the collection comprises IDE, WebDriver API(language binding), Grid, Selenium Standalone Server, browser driver. One has to download the appropriate ones to build a project.

什么是 WebDriver?

What is WebDriver?

WebDriver 是一个 API.它是用一种以上的语言编写的,它们被称为语言绑定.API 具有控制浏览器的功能.您可以使用这些函数编写脚本,以您想要的方式(测试用例)控制浏览器.

WebDriver is an API. It is written in more than one language which and they are called language bindings. The API has functions to control a browser. You use the functions in writing a script that controls a browser in the way(test case) you want.

这是我所知道的.请在我错的地方纠正我.想知道面试中这两个问题的答案.

This is what I know. Please correct me wherever I'm wrong. I want to know the answers to the two questions in the interview point of view.

推荐答案

Selenium

Selenium 是一个免费(开源)的 Web 应用程序自动化测试套件跨不同的浏览器和平台.它主要用于自动化 Web 应用程序以进行测试,但当然不仅限于此.Selenium 得到了所有主要浏览器供应商的支持,这些供应商已采取(或正在采取)措施使 Selenium 成为其浏览器的本机部分.它也是无数其他浏览器自动化工具、API 和框架的核心技术.

Selenium

Selenium is a free (open source) automated testing suite for web applications across different browsers and platforms. Primarily it is used for automating web applications for testing purposes, but is certainly not limited to just that. Selenium has the support of all of the major browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks.

Selenium 不仅仅是一个工具,而是一组不同的软件工具,每个工具都有不同的方法来支持组织的测试自动化.以前从更广泛的角度来看,它有以下四个组成部分:

Selenium is not just a single tool but a set of different software tools each with a different approach to support the test automation of an organization. From a broader perspective previously it had four components as follows:

  • Selenium 集成开发环境 (IDE)
  • 硒远程控制 (RC)
  • 网络驱动
  • 硒网格

一年前,Selenium RCWebDriver 合并为一个框架,形成 Selenium 2.x.也许,Selenium 1 指的是 Selenium RC.当前发布的版本是 Selenium 3.x.

An year ago, Selenium RC and WebDriver are merged into a single framework to form Selenium 2.x. Perhaps, Selenium 1 refers to Selenium RC. The current released version is Selenium 3.x.

Selenium-RC 对每个支持的浏览器都以相同的方式工作.它在浏览器加载时注入javascript函数到浏览器中,然后使用它的javascript在浏览器中驱动AUT.Selenium WebDriver 与 Selenium-RC 的作用相同,并整合了原始的1.x 绑定并包含 WebDriver API.它指的是语言绑定和各个浏览器控制代码的实现.这通常称为 WebDriver.简而言之,WebDriver 是一个远程控制界面,可以对用户代理.WebDriver 提供了一个平台和语言中立的有线协议,作为进程外程序远程指导网络浏览器行为的一种方式.

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. Selenium WebDriver fits in the same role as Selenium-RC did and has incorporated the original 1.x bindings and included the WebDriver API. It refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just WebDriver. In short, WebDriver is the remote control interface that enables introspection and control of user agents. WebDriver provides a platform and language-neutral wire protocol as a way for out-of-process programs to remotely instruct the behavior of web browsers.

  • WebDriver 采用更简单、更简洁的编程接口设计,同时解决了 Selenium-RC API 中的一些限制.
  • 与 Selenium1.0 相比,WebDriver 是一个紧凑的面向对象的 API
  • 它更有效地驱动浏览器并克服了 Selenium 1.x 的限制,这些限制影响了我们的功能测试覆盖率,例如文件上传或下载、弹出窗口和对话框障碍
  • WebDriver 克服了 Selenium RC 的单主机来源政策的限制.

WebDriver 是Java/C#/Ruby/Python/NodeJS 编写测试的关键接口的名称,你可以使用的实现类如下:

WebDriver is the name of the key interface against which tests should be written in Java/C#/Ruby/Python/NodeJS, the implementing classes which you can use are listed as below:

这篇关于什么是 Selenium,什么是 WebDriver?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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