我正在尝试使用java代码运行jmeter脚本。
我已按照说明操作,但在尝试调用SaveService.loadTree(文件)时,出现错误:
java.lang.IllegalArgumentException: Problem loading XML from:'file path/file.jmx', missing class com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jorphan.collections.ListedHashTree
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number : 31
version : 3.3 r1808647
-------------------------------
答案 0 :(得分:0)
您的HTTPSamplerProxy
在定义方面存在问题。关注example:
HTTPSamplerProxy examplecomSampler = new HTTPSamplerProxy();
examplecomSampler.setDomain("uttesh.com");
examplecomSampler.setPort(80);
examplecomSampler.setPath("/");
examplecomSampler.setMethod("GET");
examplecomSampler.setName("Open uttesh.com");
examplecomSampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName());
examplecomSampler.setProperty(TestElement.GUI_CLASS, HttpTestSampleGui.class.getName());
....
HashTree threadGroupHashTree = testPlanTree.add(testPlan, threadGroup);
threadGroupHashTree.add(examplecomSampler);
答案 1 :(得分:0)
我发现“ApacheJMeter_http”依赖项不在我的pom.xml文件中。 “ApacheJMeter_core”不包括基本测试运行所需的所有文件。