How to Open Chrome in Selenium

Posted By : Sandeep Rathor | 05-Apr-2017

Selenium Webdriver is a Automation tool that is widely use in IT industry.

Here are some steps you need to follow to open Chrome in Selenium


After Installation of Webdriver, we just need to import the Jar file to perform certain tasks. In earlier Selenium 2 support by default Mozila Firefox browser. So now the Question is this how we can use the wedriver for other browser?


To perform multiple operation on other browser we just need to install the .exe file for that particular browser and after that selenium support to run Webdriver accordingly we just need to write the selenium script by using the programing languages. 


Most of the Web Application support Chorme because as compare to other Web browser chrome is mostly used by the people worldwide. So as a Tester there is compultion to test your web app on Chrome. To run the Selenium webdriver for Chrome, first we need to install the latest version of ChromeDriver for webdriver. If you are working on Windows than you need to download ChromeDriver jars according to Windows. You need to click on the "".


After impoting the Jar files specify the path of the Chromedriver in your code, here giving an example of my code 


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;



public void testGoogleSearch() {

  // Optional, if not specified, WebDriver will search your path for chromedriver.

  System.setProperty("", "/path/to/chromedriver");


  WebDriver driver = new ChromeDriver();


  Thread.sleep(5000);  // Let the user actually see something!

  WebElement searchBox = driver.findElement("q"));



  Thread.sleep(5000);  // Let the user actually see something!



In above program we imported the two packages of chrome driver and by using WebDriver we initialize the driver.



Request for Proposal

Recaptcha is required.

Sending message..