Jmeter - Ant - NoHttpResponseException(Jmeter - Ant - NoHttpResponseException)
我有一个JMeter测试,我已经使用超过6个月。 目前我一直在非GUI模式下通过命令行(无ANT)运行它。
这是我通过命令行运行时所做的事情
"%JMETER_HOME%\bin\jmeter.bat" -n -t %TESTNAME% -p %PROPPATH% -l %RESULTPATH% -j %LOGPATH% -Djmeter.save.saveservice.output_format=xml -Djmeter.save.saveservice.thread_counts=true
我最近想过使用Ant。 每当我运行相同的测试(当然为测试相同的应用程序) - 我得到以下错误。
Non HTTP response code: org.apache.http.NoHttpResponseException - Non HTTP response message: The target server failed to respond
应用程序没有问题,应用程序工作正常 - 日志中没有例外。 如果我不使用Ant - 错误就会消失。 我一次又一次地尝试 - w / Ant&w / o Ant - 5次。 当我使用Ant时,我得到了一致的错误。
我总是以XML格式保存结果,传递相同的属性文件。 没有其他差异。
这是我的Ant构建文件。
<jmeter jmeterhome="${jmeter.home}" testplan ="${test.path}/${test.name}.jmx" resultlog="${test.result.path}/${test.name}.jtl" jmeterproperties="${test.properties}/${property.file.name}.properties" jmeterlogfile="${test.result.log}/jmeter.log" > <property name="jmeter.save.saveservice.output_format" value="xml"/> <property name="jmeter.save.saveservice.assertion_results" value="all"/> <property name="jmeter.save.saveservice.thread_counts" value="true"/> <property name="jmeter.save.saveservice.bytes" value="true"/> <property name="file_format.testlog" value="2.1"/> <property name="jmeter.save.saveservice.response_data.on_error" value="false"/> <property name="includecontroller.prefix" value="${basedir}/test/modules/"/> </jmeter>
我不知道这里有什么问题。
我面临的问题也只是在15分钟的运行后才发生。 不是马上。 看起来像记忆相关的东西......不确定。
编辑::
正如迪米特里所说,这是我有的可用记忆
命令行= 499Mb
Ant = 247Mb
机器中的环境变量
ANT_OPTS = -Xmx1024m -Xms512m这是我用200个用户运行测试的机器细节。
I have a JMeter test which i have been using for more than 6 months. Currently I have been running this via command line (no ANT) in non GUI mode.
This is what i do when i run via command line
"%JMETER_HOME%\bin\jmeter.bat" -n -t %TESTNAME% -p %PROPPATH% -l %RESULTPATH% -j %LOGPATH% -Djmeter.save.saveservice.output_format=xml -Djmeter.save.saveservice.thread_counts=true
I recently thought of using Ant. Whenever I run the same test (ofcourse for testing the same application) - I get below error.
Non HTTP response code: org.apache.http.NoHttpResponseException - Non HTTP response message: The target server failed to respond
There is no issue with the application and the application works perfectly fine - no exception in the log. If I do not use Ant - the error disappears. I tried again and again - w/ Ant & w/o Ant - 5 times. I get the error consistently when i use Ant.
I always the save the result in XML format, pass the same property files. No other differences.
This is from my Ant build file.
<jmeter jmeterhome="${jmeter.home}" testplan ="${test.path}/${test.name}.jmx" resultlog="${test.result.path}/${test.name}.jtl" jmeterproperties="${test.properties}/${property.file.name}.properties" jmeterlogfile="${test.result.log}/jmeter.log" > <property name="jmeter.save.saveservice.output_format" value="xml"/> <property name="jmeter.save.saveservice.assertion_results" value="all"/> <property name="jmeter.save.saveservice.thread_counts" value="true"/> <property name="jmeter.save.saveservice.bytes" value="true"/> <property name="file_format.testlog" value="2.1"/> <property name="jmeter.save.saveservice.response_data.on_error" value="false"/> <property name="includecontroller.prefix" value="${basedir}/test/modules/"/> </jmeter>
I have no idea what is wrong here.
Also the issue i am facing with Ant happens only after 15 mins of run. not immediately. Looks like something related with memory...not sure.
EDIT::
As Dimitri has said, This is the available memory i have
Command line = 499Mb
Ant = 247Mb
Environment variable in the machine
ANT_OPTS=-Xmx1024m -Xms512m This is the machine detail where i run my test with 200 users.
原文:
最满意答案
首先创建一个包含选定值的类的数组
var selected = $(this).val(); selected = selected.split(" ");
其次,将它们加入由逗号分隔的字符串中,以便以逗号分隔字符串中的所有类。
selected = selected.join(',');
第三,使用字符串作为jquery选择器来添加类
$(selected).addClass("active"); //for example $(".recs,.green").addClass("active")
First you create an array with the classes of the selected value
var selected = $(this).val(); selected = selected.split(" ");
Second, you join them in a string separated by comma to get all classes in a string separated with comma.
selected = selected.join(',');
Third, you use the string as a jquery selector to add the class
$(selected).addClass("active"); //for example $(".recs,.green").addClass("active")
相关问答
更多-
jquery将活动类添加到所有div,但只想要活动类(Jquery adding active class to all divs but only want the active one)[2023-09-01]
那么,你的索引是/ ,因为你将类添加到所有链接的href属性以当前pathname结尾( 这是/和所有链接以/结尾 ),这是有道理的。 在您提供的示例中,您可以定位与路径名相同的元素,而不是以-e结尾 $('#navigation').find('a[href="' + pathname + '"]').addClass("active-link") Well, your index is / and since you add the class to all links whose href attr ... -
根据选择选项显示多个DIVS(内部有表单元素)(Display Multiple DIVS ( with form elements inside ) based on select choice)[2023-10-28]
将类block添加到所有块div元素