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.
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
All implementation of WebDriver - whether it is the
IEServerDriver need to use this wire protocol to communicate with the respective browsers.
wire protocol is implemented in
request/response pairs of
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
Hey, But What About ChromeDriver?
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 -
- Browser - The Chrome browser itself.
- 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
For example, in Java you call this
- 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
1and the "driver" from
So, it is actually a
middleman between your code and your browser- yikes sounds gross.
Here is a good read.
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.