Class SmartClientGeckoDriverServiceBuilder

java.lang.Object
org.openqa.selenium.remote.service.DriverService.Builder<DS,B>
org.openqa.selenium.firefox.FirefoxDriverService.Builder<org.openqa.selenium.firefox.GeckoDriverService,org.openqa.selenium.firefox.GeckoDriverService.Builder>
org.openqa.selenium.firefox.GeckoDriverService.Builder
com.isomorphic.webdriver.SmartClientGeckoDriverServiceBuilder

public class SmartClientGeckoDriverServiceBuilder extends org.openqa.selenium.firefox.GeckoDriverService.Builder
Builds a GeckoDriverService whose control port is the one the caller passed to DriverService.Builder.usingPort(int), and nothing else.

Selenium's own builder opens two listening ports per browser: the geckodriver control port, and a websocket port that it also hands to Firefox as its remote-debugging port. Both are picked by Selenium from a range of "free" ports that includes the ports a test environment may have reserved for its own servers, so a browser that happens to outlive a server start can sit on that server's port. This builder emits the geckodriver control port only, so that a caller who assigns the port controls every listener the browser opens. Pair it with SmartClientFirefoxDriver(GeckoDriverService, org.openqa.selenium.firefox.FirefoxOptions), which turns off the Firefox remote-debugging listener the dropped websocket port was meant for.

Without DriverService.Builder.usingPort(int) the control port is still Selenium-picked, so the builder only adds value when the port is supplied.