I am running the following but getting the error
public class base
{
public static WebDriver driver;
public static void main(String[] args) throws MalformedURLException, InterruptedException
{
System.setProperty("webdriver.chrome.driver", "C:\code\lib\browser drivers\chromedriver.exe");
String URL = "http://www.google.com";
String Node = "http://localhost:4444/wd/hub";
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap = DesiredCapabilities.chrome();
cap.setPlatform(org.openqa.selenium.Platform.WINDOWS);
driver = new RemoteWebDriver(new URL(Node), cap);
driver.navigate().to(URL);
Thread.sleep(5000);
driver.quit();
}
}
Error shown is as follows :
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new service: ChromeDriverService
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'RAJESHW10', ip: '169.254.3.253', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: driver.version: unknown
Command duration or timeout: 316 milliseconds
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Can somebody please help
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…