Unable to initiate Chrome Browser in Junit in selenium webdr | Selenium Forum
M
Posted on 09/10/2016
I am trying to run the below code in Junit however I am unable to initiate the chrome browser, please help!!


package ChromeText;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class ChromeTest {

private static WebDriver driver;
@BeforeClass
public static void setUp(){
System.setProperty("webdriver.chrome.driver", "C:\\Users\\test.user\\Documents\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
}

@Test
public void testChromeSelenium() {
driver.get("http://www.google.com");
}

@AfterClass
public static void kill(){
if (driver != null) {
driver.close();
driver.quit();
}
}

}

M
Replied on 10/10/2016

do you get any error?