I am trying to launch chrome browser using RemoteWebDriver with the following code.
File file = new File("E:\\S\\chromedriver.exe"); //path to the chromedriver.exe so downloaded
//System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
//capability.setVersion("38.0.2125.122 m");
WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:9898/"),capability);
I got the following error:
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
I've checked that the port 9898 is open. I've added localhost in hosts in C:\Windows\System32\drivers\etc\hosts
Update: I can see two more exceptions.
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:9515 [/127.0.0.1] failed: Connection refused.
Caused by: java.net.ConnectException: Connection refused: