2 回答
TA贡献1884条经验 获得超4个赞
相关的类是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());
将属性替换为您选择的值,包括最终的默认参数。
TA贡献1789条经验 获得超10个赞
您可以找到其层次结构如下:
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
添加回答
举报