According to this documentation:
One can do something like:
WebDriver driver = new ChromeDriver()
DriverFactory.changeWebDriver(driver)
However, looking at the source, it appears that the changeWebDriver() currently has a private access modifier:
private static void changeWebDriver(WebDriver webDriver) {
changeWebDriverWithoutLog(webDriver);
logBrowserRunData(webDriver);
switchToSmartWaitWebDriver(webDriver);
}
Is there any chance that this could become public facing again? If not, could we get another method to set a custom driver at runtime? If not, please update the documentation.
Some context:
I’m trying to implement a way to modify request headers programmatically using BrowserMob. Basically, I can instantiate my own webdriver, and associate a custom BrowserMob proxy (with custom headers) with that driver through desired capabilities. The problem is that I can’t then inject that back into the DriverFactory as shown above.
Thanks in advance!