2 回答

TA貢獻(xiàn)1884條經(jīng)驗(yàn) 獲得超4個贊
相關(guān)的類是ConfigTestElement,可以按如下方式初始化:
ConfigTestElement httpRequestDefaults = new ConfigTestElement();
httpRequestDefaults.setName("HTTP Request Defaults");
httpRequestDefaults.setProperty(new TestElementProperty("HTTPsampler.Arguments", new HTTPArgumentsPanel().createTestElement()));
httpRequestDefaults.setProperty("HTTPSampler.domain", "hostname or IP address of your server");
httpRequestDefaults.setProperty("HTTPSampler.port", "1234");
httpRequestDefaults.setProperty("HTTPSampler.protocol", "https");
httpRequestDefaults.setProperty("HTTPSampler.contentEncoding", "UTF-8");
httpRequestDefaults.setProperty("HTTPSampler.path", "/");
httpRequestDefaults.setProperty("HTTPSampler.concurrentPool", "6");
httpRequestDefaults.setProperty("HTTPSampler.connect_timeout", "10000");
httpRequestDefaults.setProperty("HTTPSampler.response_timeout", "10000");
httpRequestDefaults.setProperty(TestElement.TEST_CLASS, ConfigTestElement.class.getName());
httpRequestDefaults.setProperty(TestElement.GUI_CLASS, HttpDefaultsGui.class.getName());
將屬性替換為您選擇的值,包括最終的默認(rèn)參數(shù)。

TA貢獻(xiàn)1789條經(jīng)驗(yàn) 獲得超10個贊
您可以找到其層次結(jié)構(gòu)如下:
Class?HttpDefaultsGui ?java.lang.Object ??java.awt.Component ???java.awt.Container ????javax.swing.JComponent ?????javax.swing.JPanel ??????org.apache.jmeter.gui.AbstractJMeterGuiComponent ???????org.apache.jmeter.config.gui.AbstractConfigGui ????????org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui
添加回答
舉報(bào)