Execute Selenium Scripts using Web-driver in Chrome Browser

Posted by

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 :

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

Leave a Reply

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