如何访问系统。Jmeter的Java示例中的getProperty()
这就是我想要达到的目标
public class Jmetertest extends AbstractJavaSamplerClient {
public void setupTest(JavaSamplerContext context) {
TestConfig.load(System.getProperty("configFile"));
// This configFile has all the properties which I need to run my test
}
public void teardownTest(JavaSamplerContext context) {..}
public SampleResult runTest(JavaSamplerContext context) {
// test code
}
}
我知道我可以使用
public Arguments getDefaultParameters() {..}
但是我想知道,我怎样才能访问jmeter中的System.getProperty();
,这样我就可以使用对我来说更方便的东西了
# 1 楼答案
您可以这样做:
我认为这个链接可以帮助你: java.lang.System.getProperty