Search code examples
javaselenium-webdriverselenium-chromedriverselenium-grid

Unable to create new Chrome remote session


I'm trying to launch a new Chrome browser using Selenium Grid but ending up with the below error

Unable to create new remote session. desired capabilities = Capabilities [{browserName=chrome, version=55.0.2, platform=WINDOWS}], required capabilities = Capabilities [{}] Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700' System info: host: 'PL9710388', ip: '10.61.249.5', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111' Driver info: driver.version: RemoteWebDriver

Below is my code to launch the Remote browser

java -Dwebdriver.chrome.driver=C:\chromedriver.exe -jar selenium-server-standalone-3.0.1.jar -role hub

java -Dwebdriver.chrome.driver=C:\chromedriver.exe -jar selenium-server-standalone-3.0.1.jar -role node

cap = DesiredCapabilities.chrome();
cap.setVersion("55.0.2");
cap.setBrowserName("chrome");
cap.setPlatform(org.openqa.selenium.Platform.WINDOWS);
browser = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),cap);

Could you please help me on what is wrong?


Solution

  • make sure your code is able to find the chromedriver in your system. You can set the path programatically, you can even download and keep your driver from the below link

    System.setProperty("webdriver.chrome.driver","/path to/chromedriver.exe");
    cap = DesiredCapabilities.chrome();
    cap.setPlatform(org.openqa.selenium.Platform.WINDOWS);
    browser = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),cap);