Earn Money in 10 days

Selenium Videos

Protractor In Selenium

Livechat

Showing posts with label Launch Google chrome browser using selenium. Show all posts
Showing posts with label Launch Google chrome browser using selenium. Show all posts

Saturday, 8 November 2014

How to Open Google Chrome browser using Selenium

First you need to download driver Server for chrome.Selenium WebDriver works very well with Mozilla Firefox because it has a built in driver server. But the same is not true  Google Chrome.Google Chrome doesn’t have a built-in server so you will need a Chrome driver server for communicating your Selenium code to the browser. You can download the Chrome driver server from here.

 Just download and unzip this file and add the path of that server file.I have added snapshot below.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class TestChrome {
public static void main(String str[]){
//Now you have to setSet the system property and add chromedriver path into it.
//System.setProperty("webdriver.ie.driver","Chrmepath")
System.setProperty("webdriver.chrome.driver","D:\\gc\\ChromeDriver.exe");
      WebDriver Drive =  new ChromeDriver();
      Drive.get("http://facebook.com");
}
}

 This will open facebook login in your ChromeBrowser.


Popular Posts

 
subscribe
Subscribe Us
emailSubscribe to our mailing list to get the updates to your email inbox... We can't wait more to have your email in our subscribers email list. Just put your nice email in below box: