Search code examples
webdriverselenium-grid

How to run webdriver tests in Selenium Grid linux and firefox


How to run webdriver tests in Selenium Grid linux and firefox. After setting up the selenium Grid and registering the node with the hub when i try to run the below code throws class not found error, any thoughts.

    URL server = new URL("http://127.0.0.1:4444/wd/hub");

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setBrowserName("firefox");

    System.out.println("Connecting to " + server);

    RemoteWebDriver driver = new RemoteWebDriver(server, capabilities);

    driver.get("http://www.google.com");

    driver.quit();

Solution

  • Satish, check the error in stack trace. It says

    Caused by: java.lang.ClassNotFoundException: com.app.tests.RemoteTest

    This is NOT a selenium exception. Your class file RemoteTest is not in the classpath.You need to set it in the classpath.