什么是硒,什么是WebDriver? [英] What is Selenium and what is WebDriver?

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

问题描述

什么是硒?

当您打开Selenium的官方页面时,您首先读到的是什么是Selenium?"中的"Selenium automates browser".部分. 硒的哪个部分适合我?"部分下面提供了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 是针对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:

  • 硒综合开发环境(IDE)
  • 硒遥控器(RC)
  • WebDriver
  • 硒网格

一年前, Selenium RC WebDriver 合并到一个框架中,形成了 Selenium 2.x .也许硒1 是指硒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提供了一种平台和语言无关的有线协议,作为进程外程序远程指示Web浏览器行为的一种方式.

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 is designed in a simpler and more concise programming interface along with addressing some limitations in the Selenium-RC API.
  • WebDriver is a compact Object Oriented API when compared to Selenium1.0
  • It drives the browser much more effectively and overcomes the limitations of Selenium 1.x which affected our functional test coverage, like the file upload or download, pop-ups and dialogs barrier
  • WebDriver overcomes the limitation of Selenium RC's Single Host origin policy.

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:

  • ChromeDriver
  • EventFiringWebDriver
  • FirefoxDriver
  • HtmlUnitDriver
  • InternetExplorerDriver
  • PhantomJSDriver
  • RemoteWebDriver
  • SafariDriver

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

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