0

Is it possible to run the hub and nodes in Selenium Grid through Java/Selenium code? In an example provided by @Boni Garcia, there is GridLauncherV3 but this is not working with Selenium-jupiter version 3.2.1. Can you please help?

    // Start hub

    GridLauncherV3.main(new String[] { "-role", "hub", "-port", "4444" });

    // Register Chrome in hub
    WebDriverManager.chromedriver().setup();
    GridLauncherV3.main(new String[] { "-role", "node", "-hub",
            "http://localhost:4444/grid/register", "-browser",
            "browserName=chrome", "-port", "5555" });
    '''
Boni García
  • 4,618
  • 5
  • 28
  • 44
Lokesh
  • 1
  • I want to run it for cross browser. That means, one test for 3 browsers, primarily for IE, Firefox and Chrome. How can I do that? – Lokesh May 27 '19 at 07:43
  • @Boni Garcia, could you please take a look at this question. Is it something you are able to answer? Thanks. https://stackoverflow.com/questions/71009889/is-there-a-way-to-call-a-java-method-that-extends-a-webdriver-class?noredirect=1#comment125529022_71009889 – Testilla Feb 06 '22 at 18:09

1 Answers1

1

This example is working at the time of this writing, I have just double checked. Just notice it is disabled, an so you need to remove the @Disabled annotation to execute it.

Boni García
  • 4,618
  • 5
  • 28
  • 44
  • I could do it. However I want to run it for cross browser. That means, one test for 3 browsers, primarily for IE, Firefox and Chrome. How can I do that? – Lokesh May 21 '19 at 12:47