I am to provide a Selenium grid and would like to enforce that our developers no longer use the RC API. From what I learnt RC is deprecated and on the client side you need to import the legacy code: https://seleniumhq.github.io/selenium/docs/api/java/deprecated-list.html
But what if a developer uses the old RC calls ? I found no way to disable support for RC on the hub. I made my attempts on Selenium 3.4.0
There is no direct way of doing this. But here's a hack of how this can be done.
org.openqa.grid.selenium.proxy
DefaultRemoteProxy
instead of what is available in the Selenium codebase) DefaultRemoteProxy
alter its constructor to as shown below. java -cp
(Feel free to choose whichever option works for you) After this, you should be able to prevent people from registering their nodes to your hub wherein the protocol is Selenium RC.
public DefaultRemoteProxy(RegistrationRequest request, Registry registry) {
super(request, registry);
for (TestSlot slot : getTestSlots()) {
if (slot.getProtocol() == SeleniumProtocol.Selenium) {
throw new IllegalStateException("Selenium RC Protocol is NOT supported.");
}
}
pollingInterval = config.nodePolling != null ? config.nodePolling : DEFAULT_POLLING_INTERVAL;
unregisterDelay = config.unregisterIfStillDownAfter != null ? config.unregisterIfStillDownAfter : DEFAULT_UNREGISTER_DELAY;
downPollingLimit = config.downPollingLimit != null ? config.downPollingLimit : DEFAULT_DOWN_POLLING_LIMIT;
}
This should help you achieve what you are after.
The flip side of this is that you would need to make sure you are constantly monitoring the contents of org.openqa.grid.selenium.proxy.DefaultRemoteProxy in the Selenium codebase and keep updating your local version else you may run into a situation wherein things go out of sync.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.