public HTTPSamplerBase getSampler(Map pageEncodings, Map formEncodings)
throws MalformedURLException, IOException, ProtocolException {
// Damn! A whole new GUI just to instantiate a test element?
// Isn't there a beter way?
HttpTestSampleGui tempGui = null;
// Create the corresponding gui for the sampler class
if(sampler instanceof HTTPSampler2) {
tempGui = new HttpTestSampleGui2();
}
else {
tempGui = new HttpTestSampleGui();
}
sampler.setProperty(TestElement.GUI_CLASS, tempGui.getClass().getName());
// Populate the sampler
populateSampler(pageEncodings, formEncodings);
tempGui.configure(sampler);
tempGui.modifyTestElement(sampler);
// Defaults
sampler.setFollowRedirects(false);
sampler.setUseKeepAlive(true);
if (log.isDebugEnabled())