Execute Selenium Scripts using Web-driver in Chrome Browser

By default, support of Selenium Web-driver is for Firefox browser only. That is the reason may be, if we/you use Firefox we/you did not face any issue while working with Firefox. But we can execute your scripts in the different browser like chrome, IE etc. Today we are discussing and work on chrome driver in this session.

Code Example:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Chromesession
{
public static void main(String[] args)
{
System.setProperty(“webdriver.chrome.driver”, “path of the exe file\\chromedriver.exe”);
WebDriver driver=new ChromeDriver();
driver.get(“http://www.google.com”);
driver.manage().window().maximize();
}
}

Execute Selenium Scripts using Web-driver in Chrome Browser

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top