@Override
public void modifyTestElement(TestElement element) {
configureTestElement(element);
if(element instanceof WebDriverConfig) {
WebDriverConfig webDriverConfig = (WebDriverConfig)element;
if(directProxy.isSelected()) {
webDriverConfig.setProxyType(ProxyType.DIRECT);
} else if(autoDetectProxy.isSelected()) {
webDriverConfig.setProxyType(ProxyType.AUTO_DETECT);
} else if(pacUrlProxy.isSelected()) {
webDriverConfig.setProxyType(ProxyType.PROXY_PAC);
} else if(manualProxy.isSelected()) {
webDriverConfig.setProxyType(ProxyType.MANUAL);
} else {
webDriverConfig.setProxyType(ProxyType.SYSTEM); // fallback
}
webDriverConfig.setProxyPacUrl(pacUrl.getText());
webDriverConfig.setHttpHost(httpProxyHost.getText());
webDriverConfig.setHttpPort(Integer.parseInt(httpProxyPort.getText()));
webDriverConfig.setUseHttpSettingsForAllProtocols(useHttpSettingsForAllProtocols.isSelected());
webDriverConfig.setHttpsHost(httpsProxyHost.getText());
webDriverConfig.setHttpsPort(Integer.parseInt(httpsProxyPort.getText()));
webDriverConfig.setFtpHost(ftpProxyHost.getText());
webDriverConfig.setFtpPort(Integer.parseInt(ftpProxyPort.getText()));
webDriverConfig.setSocksHost(socksProxyHost.getText());
webDriverConfig.setSocksPort(Integer.parseInt(socksProxyPort.getText()));
webDriverConfig.setNoProxyHost(noProxyList.getText());
// EXPERIMENTAL
webDriverConfig.setRecreateBrowserOnIterationStart(recreateBrowserOnIterationStart.isSelected());
webDriverConfig.setDevMode(devMode.isSelected());
}
}