我是JMeter和断言概念的新手。当我尝试执行JMX中包含断言的JMX文件时遇到此错误消息:
断言错误:false 断言失败:是的 断言失败消息:测试失败:变量(搜索结果)不等于/ 收到:未找到[[[[]]]] 比较:未找到[[[[]]]]
脚本以这种方式执行: $ java -jar ./apache-jmeter-2.10/bin/ApacheJMeter.jar -t ./jmeter-master/test.jmx -Jhost = myhost.com -Joutput_suffix = localtest
我试图在MySQL中删除数据库表的内容,重新填充它们,然后重新执行jmx文件。但是,它仍然失败,上面显示相同的错误消息。
jmeter.log仅指示以下信息: 2013/11/27 05:58:52错误 - jmeter.threads.JMeterThread:测试失败! java.lang.OutOfMemoryError at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:284) 在org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:27) 在org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:130) 在org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:85) 在org.mozilla.javascript.Context.compileImpl(Context.java:2394) 在org.mozilla.javascript.Context.compileString(Context.java:1335) 在org.mozilla.javascript.Context.compileString(Context.java:1324) 在org.mozilla.javascript.Context.evaluateString(Context.java:1076) 在org.apache.jmeter.control.IfController.evaluateCondition(IfController.java:110) 在org.apache.jmeter.control.IfController.next(IfController.java:167) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:214) 在org.apache.jmeter.control.GenericController.next(GenericController.java:174) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223) 在org.apache.jmeter.control.GenericController.next(GenericController.java:174) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:214) 在org.apache.jmeter.control.GenericController.reInitializeSubController(GenericController.java:274) 在org.apache.jmeter.control.GenericController.reInitializeSubController(GenericController.java:275) 在org.apache.jmeter.control.IfController.next(IfController.java:178) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:214) 在org.apache.jmeter.control.GenericController.next(GenericController.java:174) 在org.apache.jmeter.control.LoopController.next(LoopController.java:118) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223) 在org.apache.jmeter.control.GenericController.next(GenericController.java:174) 在org.apache.jmeter.control.LoopController.next(LoopController.java:118) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223) 在org.apache.jmeter.control.GenericController.next(GenericController.java:174) 在org.apache.jmeter.control.LoopController.next(LoopController.java:118) 在org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223) 在org.apache.jmeter.control.GenericController.next(GenericController.java:174) 在org.apache.jmeter.control.LoopController.next(LoopController.java:118) at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:88) 在org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) 在java.lang.Thread.run(Thread.java:769)
这是在JTL文件中记录的消息:
/</failureMessage>
</assertionResult>
</httpSample>
<httpSample t="436" lt="406" ts="1385112442588" s="true" lb="Homepage:Home" rc="200" rm="OK" tn="Thread Group 1-4" dt="text" by="238401" sc="1" ec="0" ng="6" na="6"/>
<httpSample t="111" lt="34" ts="1385112445679" s="false" lb="Search:Leads" rc="200" rm="OK" tn="Thread Group 1-2" dt="text" by="15237" sc="1" ec="1" ng="6" na="6">
<assertionResult>
<name>Check for found lead</name>
<failure>true</failure>
<error>false</error>
<failureMessage>Test failed: variable(searchResult) expected not to equal /
****** received : NOT_FOUND[[[]]]
****** comparison: NOT_FOUND[[[]]]
/</failureMessage>
</assertionResult>
</httpSample>
<httpSample t="138" lt="124" ts="1385112448413" s="false" lb="Search:Leads" rc="200" rm="OK" tn="Thread Group 1-4" dt="text" by="182785" sc="1" ec="1" ng="6" na="6">
<assertionResult>
<name>Check for found lead</name>
<failure>true</failure>
<error>false</error>
<failureMessage>Test failed: variable(searchResult) expected not to equal /
****** received : NOT_FOUND[[[]]]
****** comparison: NOT_FOUND[[[]]]
Here's the segment of the JMX file that was produced and executed:
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="Result Table" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>false</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
<sampleCount>true</sampleCount>
</value>
</objProp>
<stringProp name="filename">jmeter_output_${__P(output_suffix,generic)}.xml</stringProp>
</ResultCollector>
任何人都可以提供有关解决此错误的指示吗?
非常感谢, ARI。
答案 0 :(得分:0)
日志说OutOfMemoryError。
您可以先尝试增加内存,如:
$java -Xms256m -Xmx512m -jar ./apache-jmeter-2.10/bin/ApacheJMeter.jar -t ./jmeter-master/test.jmx -Jhost=myhost.com -Joutput_suffix=localtest