I am trying to configure Selenium WebDriver with Eclipse IDE. While running my code I am getting java exception has occurred
error. How to fix this?
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test {
static WebDriver driver1=new ChromeDriver();
String user="rutvisoni";
String pass="12Abcd";
public void setup() throws IOException
{
driver1.manage().window().maximize();
driver1.get("http://example.com");
//File inputFile = new ClassPathResource("E:\\Selenium Jar\\chromedriver.exe").getFile();
System.setProperty("webdriver.chrome.driver","E:\\Selenium Jar\\chromedriver.exe");
}
public static void main(String args[]) throws IOException
{
Test t1=new Test();
t1.setup();
}
}