2

I know that Selenium Webdriver is evolved from Selenium RC. Server in the Selenium RC was used to overcome the "same origin policy" using the proxy injection. Is it that the chromedriver.exe performs same functions? I tried find the answers online could not get any satisfactory explaination. Thanks in advance.

6

Sadly none of the answers above are explaining what the real question here is. To understand how the chromedriver works fundamentally, you need to understand the root first.

What is WebDriver anyway?

Selenium WebDriver or WebDriver, as it is called, is actually an open source tool for automating testing of web-apps across many browsers. It does that by simulating the user actions on a webpage, like clicking on a button, filling out forms etc.

How does WebDriver communicates with Web Browser

Glad you asked. WebDriver communicates or messages the browser (Chrome/Firefox/Safari/IE) using an specific protocol. This is called the WebDriver JSON Wire Protocol, which is actually a RESTful web service using JSON over HTTP

All implementation of WebDriver - whether it is the ChromeDriver, the GeckoDriver, the IEServerDriver need to use this wire protocol to communicate with the respective browsers.

The wire protocol is implemented in request/response pairs of "commands"and "responses".

Oh Really! How Does It Happen?

Ok. I'm not going that far into it. To understand how this wire protocol communicates using the respective implementation, you need to know and read more about the messaging and response from the protocol. The Selenium project's Github account is a good place and it has been explained in detail here about the wire protocol.

Hey, But What About ChromeDriver?

Oh yeah! ChromeDriver is the extension of the WebDriver's wire protocolfor Chromium.

ChromeDriver actually is a standalone server which implements WebDriver's wire protocol for Chromium. It comes in an executable form, which can be downloaded from theChromeDriver's` website.

ChromeDriver actually consists of three separate pieces -

  1. Browser - The Chrome browser itself.
  2. Language Bindings (Driver) - Particular language bindings available in Java/Python/PHP/C# that you can directly use in your program/script to send commands to the ChromeDriver

For example, in Java you call this

 import org.openqa.selenium.chrome.ChromeDriver;
  1. ChromeDriver - The final and most important piece of this trilogy is the executable (that I just talked above), which acts as a bridge between "chrome" - from 1 and the "driver" from 2.

So, it is actually a middleman between your code and your browser- yikes sounds gross.

Here is a good read.

  • Thanks for your answer...simple and elegant...links are also helpful...cleared my doubt...thx – Alok Jul 10 '17 at 18:00
1

Selenium WebDriver has compatbility in pretty much most major browsers and programming languages. WebDriver has multiple interacting components:

  • A web browser.
  • A plugin/Extension to the browser (which resides inside the browser, which contains a server that implements the WebDriver JSON API).
  • A language binding which makes HTTP requests, to the previously mentioned API.

When you start code that uses WebDriver, it will open up the browser, which in turn starts the plugin. You can then send requests to perform the actions you want, such as clicking on links or typing text. As a plugin only needs to implement the JSON API, people have written plugins for all major browsers. To use a browser that has a plugin, you just need to implement a client to the JSON protocol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.