What is Selenium?
Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should) also be automated as well.
Selenium Home
As official page said, it is developed for automating web applications test such as E2E, but it can also use for automating some process.
For example, I use Selenium for automating inserting a data on web app when I click a button in client application.
There are three main products, Selenium WebDriver, Selenium IDE, Selenium Grid.
Selenium Web Driver
It is a kind of library (e.g., nuget package in c#), which provides classes and methods for driving web browser.
It is supported by .NET, Ruby, Java, Python and JavaScript and can drive Chrome, Edge, Firefox and safari?
Selenium IDE
It records your process, save and play it again. Since it is provided by browser extension, it doesn’t require programming knowledge. It can only use in Google Chrome and Firefox.
Selenium Grid
It helps with running tests in parallel across multiple machines. For example, if I developed a web application, which works on Windows and Mac operating systems and Chrome, Edge and Firefox browsers.
I need to assure the application’s quality, which requires it works correctly on each combinations, and then Selenium Grid help with it.
It enable us to execute it parallel, which saves time.
How does WebDriver talk to the browser

WebDriver
It is a class in Selenium, which developer create a instance of it.
It provides methods for talking to Driver.
Driver
Resposible for controlling the actual browser. Most drivers are created by the browser vendors themselves.
Selenium, Selenium Components
It plays intermediation role for WebDriver and Browser.
It receives http requests from WebDriver, analyze it, send request to browser, receives results from Browser and sends it. It is delivered as exe file.
WebDriver – Driver
The WebDriver protocol consists of communication between:
Local end
The local end represents the client side of the protocol, which is usually in the form of language-specific libraries providing an API on top of the WebDriver protocol. This specification does not place any restrictions on the details of those libraries above the level of the wire protocol.
W3C, “WebDriver”
Driver – Browser
I couldn’t find explanation in official site.(There might be…)
However, I found some articles which other developers wrote.
Nayani Shashikala said
Note: Browser drivers internally use browser-specific automation protocols to interact with the browser; ChromeDriver uses the Chrome DevTools Protocol(GDP), and GeckoDriver(Firefox) uses Marionette
These protocols allow the driver to send commands to the browser to perform actions like clicking buttons, filling forms, or navigating to URLs, and then receive responses indicating the outcome of those actions.
By the way, AMIT RAWAT refers to differences of before Chrome 58 and after. He said after 58 version Chromedriver controls Chrome with Chrome’s dev tool api which uses WebSocket communication and also supports remote debugging.
In addition, I confirmed Marionette which is a remote protocol, is used by GeckoDriver(firexfox) to implement WebDriver.(Marionnete documentation)
Although I couldn’t find the explanation in official document, Drivers talk to their browsers with browser-specific automation protocols to interact with the browser.
Summary
Selenium WebDriver is great tool for automation test for Web App or automating some operations.
It operates browsers by Drivers which is provided by each browsers and their automation protocols.
コメント