1

I created a grid set up and when I try to execute the scripts on grid I am getting org.openqa.selenium.SessionNotCreatedException exception.

Below is the minimal code to reproduce,

public class Gridtest {
        WebDriver driver;
        DesiredCapabilities cap;
        @Test
        public void runtest() throws MalformedURLException {        
             System.setProperty("webdriver.chrome.driver","D:\\Selenium_Grid\\chromedriver.exe");
             cap = DesiredCapabilities.chrome();
            URL url = new URL("http://192.168.0.107:4444/wd/hub");
            ChromeOptions options = new ChromeOptions();
            driver = new RemoteWebDriver(url, options);
            driver.get("http://google.com/");
            driver.close();
        }
    }

Exception:

org.openqa.selenium.SessionNotCreatedException: Unable to create new service: ChromeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2021-08-14T08:25:53'
System info: host: 'SID', ip: '192.168.0.5', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_201'
Driver info: driver.version: unknown
Command duration or timeout: 145 milliseconds

Used command to register node to hub

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.0.107:4444/grid/register/

0

1 Answer 1

1

You have to pass the driver location while registering node to hub.

java -Dwebdriver.chrome.driver ="Driver location" -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.0.107:4444/grid/register/
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.