promitheus
promitheus

Reputation: 77

Launch Selenium Grid via GridLauncherV3 in Java

I need to launch the Selenium Hub and Node via direct a Java Program, I saw examples online for launching it via GridLauncherV3 from Selenium. but I tried to do same it's not finding the class GridLauncherV3 from Selenium Grid.

Dependency -

<dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.11.0</version>
</dependency>

Java Code -

public class Test {
    public static void main(String[] args) throws Exception {
        WebDriverManager.chromedriver().setup();
        GridLauncherV3.main(new String[] { "-role", "node", "-hub", "http://localhost:4444/grid/register", "-browser",
                "browserName=chrome", "-port", "5555" });
    }
}

It showing error at GridLauncherV3 as GridLauncherV3 cannot be resolved

Upvotes: 1

Views: 1736

Answers (1)

promitheus
promitheus

Reputation: 77

I found the resolution, it was the problem with the Selenium Server jar 3.11.0, when I upgraded the dependency with the latest jar v3.14.0, it worked successfully!

<dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.14.0</version>
</dependency>

Upvotes: 1

Related Questions