Why do we need IEDriver and ChromeDriver but no Firefox Driver? - selenium

I have small doubt.
Why do we need IEdriver and Chrome Driver running selenium scrits in IE and Chrome but we do not need a firefox driver to run the script?
Is there any reason for the same?

This is because of the Native Browser approach used in WebDriver.
Each and every browser uses different JS Engine.
All drivers [Chrome Driver, IE driver, etc.,] are built based on the special JS Engine used by each browser.
Selenium offers inbuilt driver for Firefox but not for other browsers. [Not sure it may happen in future, since TestNG and JUnit library files are a part of Selenium-standalone-server right now]

Straight from a google search for FirefoxDriver, the official documentation states:
Firefox driver is included in the selenium-server-stanalone.jar available in the downloads. The driver comes in the form of an xpi (firefox extension) which is added to the firefox profile when you start a new instance of FirefoxDriver.

External drivers are the preferred process by the Selenium developers. They allow the driver versioning to be tied more closely to the browser than to Selenium, and they can be supported by the browser authors (e.g., ChromeDriver, OperaDriver). There is a long-standing plan to replace FirefoxDriver with a Mozilla-supported driver based on Mozilla's "Marionette" architecture.

Firefox driver is already included in the selenium-server-standalone.jar package.

Related

Selenium WebdriverManager

What is the difference between WebDriverManager.chromedriver().setup(); and System.setProperty("webdriver.chrome.driver","G:\\chromedriver.exe"); when do we use either of the code. I'm a newbie. Please explain.
System.setProperty("webdriver.chrome.driver","G:\\chromedriver.exe");
The above statement is used to set the driver binaries of chromedriver, for this you need to download the chromedriver.exe file and then accordingly mention the path of chromedriver.exe in the System.setproperty statement, if your chrome version is updated, then you will have to again download the appropriate chromedriver.exe file again and then set the driver binaries to proceed further, similarly for firefox you will have to download firefoxdriver.exe and then use System.setProperty to set the driver binaries.
WebDriverManager.chromedriver().setup()
This is an efficient way to set driver binaries without having to actually download the driver binaries, you can just add the webdrivermanager dependency in your maven project (pom.xml) file and then set the driver binaries using the above statement.
Webdrivermanager does the follwoing:
It checks the version of the browser installed in your machine (e.g. Chrome, Firefox).
It checks the version of the driver (e.g. chromedriver, geckodriver). If unknown, it uses the latest version of the driver.
It downloads the WebDriver binary if it is not present on the WebDriverManager cache (~/.m2/repository/webdriver by default).
WebDriverManager resolves the driver binaries for the browsers Chrome, Firefox, Opera, PhantomJS, Microsoft Edge, and Internet Explorer. For that, it provides several drivers managers for these browsers. These drivers managers can be used as follows
WebDriverManager.chromedriver().setup();
WebDriverManager.firefoxdriver().setup();
To use any specific version of chromedriver, use the below statement:
WebDriverManager.chromedriver().version("2.26").setup();
What is the difference between
WebDriverManager.chromedriver().setup(); and
System.setProperty("webdriver.chrome.driver","G:\\chromedriver.exe");
WebDriverManager.chromedriver().setup()
That will automatically download (or update) the appropriate chromedriver/chromedriver.exe for you. (It is not part of Selenium, so you must install WebDriverManager to use it).
System.setProperty("webdriver.chrome.driver","G:\\chromedriver.exe");
That sets a property with the location of chromedriver.exe. Selenium client will use this to find the binary on your system. It assumes it already exists in that location.

Which drivers come out the box with Selenium Standalone Server?

Here you can see how to make Selenium Standalone Server use the chromedriver. My question is, which drivers are include out the box in the Selenium Standalone Server jar?
Should I use the browsers drivers instead of the drivers included in the Selenium Standalone Server jar?
I know that with Firefox the Selenium Team recommend use the Firefox driver, but what about the others browsers?
The post you have pointed out as how to make Selenium Standalone Server use the chromedriver is a demonstration of using Selenium Standalone Server in Grid configuration i.e. through setting up Selenium Grid Hub and Selenium Grid Node.
Selenium 3.x releases doesn't supports any of the drivers out the box in the Selenium Standalone Server jar.
The main reason behind Selenium Team recommending to use the geckodriver (Firefox) and Mozilla Firefox Browser because both geckodriver and Mozilla Firefox Browser follows the W3C Specifications.

What are the benefits of using Marionette FirefoxDriver instead of the old Selenium FirefoxDriver for a Selenium tester?

Last weeks there has been a lot of noise about this new FirefoxDriver called Marionette. To use Firefox with Selenium, we used to use the "old" Selenium FirefoxDriver. From Firefox 48.0 onwards it is going to be required to use this new FirefoxDriver developed by Mozilla.
I understand it is required to change to that direction to get every browser supports and develops its drivers and to get drivers independent of Selenium. Besides, it is supposed if Mozilla develops its own driver, it will be faster and easier to fix issues and to develop features.
My question is, for those who create automated tests using Selenium framework, is there any benefit of using Marionette instead of the "old" Selenium supported FirefoxDriver? _(Such as a better performance, a better compatibility...)
The main advantage for using the Mozilla-provided, Marionette-based Geckodriver solution is that it works for versions of Firefox 48 and higher. The legacy driver provided and maintained by the Selenium project doesn't work for Firefox 48 or higher, and will never work for those versions of Firefox.
The legacy driver is implemented as a Firefox extension. This extension is installed in the profile used by the driver when WebDriver launches Firefox. Firefox 48 introduced two new features that disabled this browser extension. The first is the so-called "electrolysis" feature, or multiprocess Firefox. Electrolysis changes the way extensions have to deal with the browser in ways the Selenium team has not taken the time to fully understand.
The second, more important requirement is that all browser extensions must be signed by Mozilla before the browser will allow them to load. This latter feature has been in Firefox for several versions, but beginning with 48, it can no longer be disabled. The WebDriver browser extension introduces several valid security concerns for the Firefox browser, and as such, will not be signed by Mozilla's security team. This, in turn, renders the extension inoperable, and thus Selenium can no longer communicate with Firefox. The Marionette-based solution, being developed and maintained by Mozilla in the first place, is blessed by them for use in automating Firefox, and as such carries a commitment that it will continue to work with future versions moving forward.
So the primary benefit of using Marionette with Firefox 48 and higher is that it will work, whereas other solutions won't.

Does browser support WebDriver or does WebDriver support browser

Is it the browser job to support WebDriver or is it WebDriver job to support each browser?
I mean if there is a new release of Chrome does this mean that WebDriver works right away because the support is included in the new Chrome release?
Or is WebDriver support added later by the developers of WebDriver?
To run selenium webdriver in Chrome browser, we need to take the help of ChromeDriver which is a separate executable that selenium webdriver uses to control chrome. ChromeDriver is supported by the Chromium team, ChromeDriver is a standalone server which implements WebDriver's wire protocol for Chromium.
http://www.seleniumeasy.com/selenium-tutorials/how-to-run-webdriver-in-chrome-browser
Yes, Webdriver made changes later that's the reason new jars of selenium launches so rapidly.
Hope it will help you :)

Suitable Chrome driver to use with selenium tests

I was wandering since there is many chrome drivers available on the nuGet Packages Manager, which one is fitting the best with Selenium tests, does it make any difference at all?
WebDriver ChromeDriver
WebDriverChromeDriver
Selenium.WebDriver.ChromeDriver
etc...
I'm using for my >30K lines of code (and 6 different web-sites) UI test project the
WebDriver ChromeDriver
with version 26.14.313457.1, it's a separate executable that WebDriver uses to control the Chrome browser. Again it requires Chromium/Google Chrome to be installed.