I'm trying to use chrome driver with Selenium under java bindings. I follow these instructions : ChromeDriver Instructions
So I run ChromeDriver.exe, put this in my code WebDriver driver = new RemoteWebDriver("http://localhost:9515", DesiredCapabilities.chrome());
and I get this error :
Error:(33, 28) java: no suitable constructor found for RemoteWebDriver(java.lang.String,org.openqa.selenium.remote.DesiredCapabilities)
constructor org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriver(org.openqa.selenium.remote.CommandExecutor,org.openqa.selenium.Capabilities) is not applicable
(argument mismatch; java.lang.String cannot be converted to org.openqa.selenium.remote.CommandExecutor)
constructor org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriver(java.net.URL,org.openqa.selenium.Capabilities) is not applicable
(argument mismatch; java.lang.String cannot be converted to java.net.URL)
How to get chrome driver to work ?
Edit : With the other method :
System.setProperty("webdriver.chrome.driver", "PATH\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
I get these errors :
java.lang.NullPointerException
at com.example.tests.Scrapjv.testScrapjv(Scrapjv.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
...
...
...