<!--Jmeter版本信息-->
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
<hashTree>
<!--测试计划-->
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="测试计划" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<!--线程组-->
<hashTree>
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="10人线程组" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">5</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">10000</stringProp> <!--并发数-->
<stringProp name="ThreadGroup.ramp_time">50</stringProp> <!--50sec完成-->
<boolProp name="ThreadGroup.scheduler">false</boolProp> <!--调度器开关-->
<stringProp name="ThreadGroup.duration">100</stringProp> <!--持续时间,sec为单位-->
<stringProp name="ThreadGroup.delay"></stringProp> <!--启动延时,sec为单位-->
</SetupThreadGroup>
<hashTree>
<!--http sample API-->
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="users_api" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">192.168.96.168</stringProp> <!--服务器名称或者ip-->
<stringProp name="HTTPSampler.port">80</stringProp> <!--请求端口-->
<stringProp name="HTTPSampler.protocol">http</stringProp> <!--请求协议-->
<stringProp name="HTTPSampler.contentEncoding">utf-8</stringProp> <!--内容编码-->
<stringProp name="HTTPSampler.path">web/ab.html</stringProp> <!--请求路径-->
<stringProp name="HTTPSampler.method">GET</stringProp> <!--请求方法-->
<boolProp name="HTTPSampler.follow_redirects">true</boolProp> <!--跟随重定向开关-->
<boolProp name="HTTPSampler.auto_redirects">false</boolProp> <!--自动重定向开关-->
<boolProp name="HTTPSampler.use_keepalive">true</boolProp> <!--使用keepalive开关-->
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <!--使用多个/表单数据进行发布-->
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp> <!--连接超时-->
<stringProp name="HTTPSampler.response_timeout"></stringProp> <!--响应超时-->
</HTTPSamplerProxy>
<!--响应断言-->
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应代码断言" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="49586">200</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message">http code is error </stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">8</intProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应文本断言" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="3254239">jack</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message">jack is not return</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">2</intProp>
</ResponseAssertion>
<hashTree/>
jmx脚本所有内容
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
<hashTree>
<!--测试计划-->
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="测试计划" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<!--线程组-->
<hashTree>
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="10人线程组" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">5</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">10000</stringProp> <!--并发数-->
<stringProp name="ThreadGroup.ramp_time">50</stringProp> <!--50sec完成-->
<boolProp name="ThreadGroup.scheduler">false</boolProp> <!--调度器开关-->
<stringProp name="ThreadGroup.duration">100</stringProp> <!--持续时间,sec为单位-->
<stringProp name="ThreadGroup.delay"></stringProp> <!--启动延时,sec为单位-->
</SetupThreadGroup>
<hashTree>
<!--http sample API-->
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="users_api" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">192.168.96.168</stringProp> <!--服务器名称或者ip-->
<stringProp name="HTTPSampler.port">80</stringProp> <!--请求端口-->
<stringProp name="HTTPSampler.protocol">http</stringProp> <!--请求协议-->
<stringProp name="HTTPSampler.contentEncoding">utf-8</stringProp> <!--内容编码-->
<stringProp name="HTTPSampler.path">web/ab.html</stringProp> <!--请求路径-->
<stringProp name="HTTPSampler.method">GET</stringProp> <!--请求方法-->
<boolProp name="HTTPSampler.follow_redirects">true</boolProp> <!--跟随重定向开关-->
<boolProp name="HTTPSampler.auto_redirects">false</boolProp> <!--自动重定向开关-->
<boolProp name="HTTPSampler.use_keepalive">true</boolProp> <!--使用keepalive开关-->
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <!--使用多个/表单数据进行发布-->
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp> <!--连接超时-->
<stringProp name="HTTPSampler.response_timeout"></stringProp> <!--响应超时-->
</HTTPSamplerProxy>
<hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="users结果树" 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>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<sentBytes>true</sentBytes>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<!--响应断言-->
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应代码断言" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="49586">200</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message">http code is error </stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">8</intProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应文本断言" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="3254239">jack</stringProp>
</