OStack程序员社区-中国程序员成长平台

标题: What Is Selenium And What Is WebDriver? [打印本页]

作者: 菜鸟教程小白    时间: 2022-4-10 16:04
标题: What Is Selenium And What Is WebDriver?

What is Selenium?

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.

What is WebDriver?

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.



Best Answer-推荐答案


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 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:

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.


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.

Highlights of WebDriver


Current Implementation

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:






欢迎光临 OStack程序员社区-中国程序员成长平台 (http://ostack.cn/) Powered by Discuz! X3.4