![](/img/trans.png)
[英]is it possible to run and write code for Jmeter 3.3 with intellij? (java 8)
[英]Error attempting to load and run jmeter 3.3 script with java
我正在嘗試使用Java代碼運行jmeter腳本。
我已按照說明進行操作,但是在嘗試調用SaveService.loadTree(file)時出現錯誤:
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
-------------------------------
您的HTTPSamplerProxy
定義有問題。 遵循示例 :
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);
我發現pom.xml文件中沒有“ ApacheJMeter_http”依賴項。 “ ApacheJMeter_core”不包括基本測試運行所需的所有文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.