use of net.lightbody.bmp.BrowserMobProxy in project java.webdriver by sayems.
the class BrowserThreads method getDriver.
private WebDriver getDriver(boolean useBrowserMobProxy) {
if (null != webdriver && usingBrowserMobProxy != useBrowserMobProxy) {
webdriver.quit();
webdriver = null;
}
if (null == webdriver) {
Proxy proxy = null;
if (proxyEnabled || useBrowserMobProxy) {
if (useBrowserMobProxy) {
usingBrowserMobProxy = true;
browserMobProxy = new BrowserMobProxyServer();
browserMobProxy.start();
if (proxyEnabled) {
browserMobProxy.setChainedProxy(new InetSocketAddress(proxyHostname, proxyPort));
}
proxy = ClientUtil.createSeleniumProxy(browserMobProxy);
} else {
proxy = new Proxy();
proxy.setProxyType(MANUAL);
proxy.setHttpProxy(proxyDetails);
proxy.setSslProxy(proxyDetails);
}
}
determineEffectiveDriverType();
DesiredCapabilities desiredCapabilities = selectedDriverType.browser.getDesiredCapabilities(proxy);
instantiateWebDriver(desiredCapabilities);
}
return webdriver;
}
Aggregations