'RegistryBasedServlet Equivalent in Selenium 4

With Selenium 3, I was able to create custom servlets that can be configured to be used with Hub and Node.

It was possible to extend org.openqa.grid.web.servlet.RegistryBasedServlet or javax.servlet.http.HttpServlet wtih Selenium 3. But with Selenium 4, I could not find the equivalent class for org.openqa.grid.web.servlet.RegistryBasedServlet.

Please suggest what should be the approach taken with Selenium 4?

public class CustomServlet extends RegistryBasedServlet {
    // Selenium 3 example

public CustomServlet() {
    super(null);
    init();
}

public CustomServlet(Registry registry) {
    super(registry);
    init();
}

private void init() {
}
}

Example Reference : https://rationaleemotions.github.io/gridopadesham/CUSTOM_SERVLETS.html



Solution 1:[1]

Servlets are no longer supported in SG4. They completely reworked the concept so there is no just a hub. Hub is a sort of combination of several different components.

Some of those components can be customized and provided as the custom implementation using dedicated flags like --node-implementation, --distributor-implementation, --events-implementation.

You can find some relevant discussion in Selenium github.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexey R.