JMeter——jmx脚本文件解析

"1.0" encoding="UTF-8"?>
"1.2" properties="4.0" jmeter="4.0 r1823414"> 

"TestPlanGui" testclass="TestPlan" testname="测试计划" enabled="true">
      "TestPlan.comments"> "TestPlan.functional_mode">false "TestPlan.tearDown_on_shutdown">true "TestPlan.serialize_threadgroups">false "TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> "Arguments.arguments"/>  "TestPlan.user_define_classpath"> 


      <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="10人线程组" enabled="true"> "ThreadGroup.on_sample_error">continue "ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> "LoopController.continue_forever">false "LoopController.loops">5  "ThreadGroup.num_threads">10000  "ThreadGroup.ramp_time">50  "ThreadGroup.scheduler">false  "ThreadGroup.duration">100  "ThreadGroup.delay">  SetupThreadGroup> 

<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="users_api" enabled="true"> "HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> "Arguments.arguments"/>  "HTTPSampler.domain">192.168.96.168  "HTTPSampler.port">80  "HTTPSampler.protocol">http  "HTTPSampler.contentEncoding">utf-8  "HTTPSampler.path">web/ab.html  "HTTPSampler.method">GET  "HTTPSampler.follow_redirects">true  "HTTPSampler.auto_redirects">false  "HTTPSampler.use_keepalive">true  "HTTPSampler.DO_MULTIPART_POST">false  "HTTPSampler.embedded_url_re"> "HTTPSampler.connect_timeout">  "HTTPSampler.response_timeout">  HTTPSamplerProxy>

<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应代码断言" enabled="true"> "Asserion.test_strings"> "49586">200  "Assertion.custom_message">http code is error  "Assertion.test_field">Assertion.response_code "Assertion.assume_success">false "Assertion.test_type">8 ResponseAssertion>  <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应文本断言" enabled="true"> "Asserion.test_strings"> "3254239">jack  "Assertion.custom_message">jack is not return "Assertion.test_field">Assertion.response_data "Assertion.assume_success">false "Assertion.test_type">2 ResponseAssertion> 

jmx脚本所有内容

"1.0" encoding="UTF-8"?>
"1.2" properties="4.0" jmeter="4.0 r1823414">   <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="测试计划" enabled="true"> "TestPlan.comments"> "TestPlan.functional_mode">false "TestPlan.tearDown_on_shutdown">true "TestPlan.serialize_threadgroups">false "TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> "Arguments.arguments"/>  "TestPlan.user_define_classpath"> TestPlan>   <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="10人线程组" enabled="true"> "ThreadGroup.on_sample_error">continue "ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> "LoopController.continue_forever">false "LoopController.loops">5  "ThreadGroup.num_threads">10000  "ThreadGroup.ramp_time">50  "ThreadGroup.scheduler">false  "ThreadGroup.duration">100  "ThreadGroup.delay">  SetupThreadGroup>   <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="users_api" enabled="true"> "HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> "Arguments.arguments"/>  "HTTPSampler.domain">192.168.96.168  "HTTPSampler.port">80  "HTTPSampler.protocol">http  "HTTPSampler.contentEncoding">utf-8  "HTTPSampler.path">web/ab.html  "HTTPSampler.method">GET  "HTTPSampler.follow_redirects">true  "HTTPSampler.auto_redirects">false  "HTTPSampler.use_keepalive">true  "HTTPSampler.DO_MULTIPART_POST">false  "HTTPSampler.embedded_url_re"> "HTTPSampler.connect_timeout">  "HTTPSampler.response_timeout">  HTTPSamplerProxy>  <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="users结果树" enabled="true"> "ResultCollector.error_logging">false  saveConfig class="SampleSaveConfiguration"> <time>truetime> <latency>truelatency> <timestamp>truetimestamp> <success>truesuccess> <label>truelabel> <code>truecode> <message>truemessage> <threadName>truethreadName> <dataType>truedataType> <encoding>falseencoding> <assertions>trueassertions> <subresults>truesubresults> <responseData>falseresponseData> <samplerData>falsesamplerData> <xml>falsexml> <fieldNames>truefieldNames> <responseHeaders>falseresponseHeaders> <requestHeaders>falserequestHeaders> <responseDataOnError>falseresponseDataOnError> <saveAssertionResultsFailureMessage>truesaveAssertionResultsFailureMessage> <assertionsResultsToSave>0assertionsResultsToSave> <bytes>truebytes> <sentBytes>truesentBytes> <threadCounts>truethreadCounts> <idleTime>trueidleTime> <connectTime>trueconnectTime> value> objProp> <stringProp name="filename">stringProp> ResultCollector> <hashTree/>  <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应代码断言" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="49586">200stringProp> collectionProp> <stringProp name="Assertion.custom_message">http code is error stringProp> <stringProp name="Assertion.test_field">Assertion.response_codestringProp> <boolProp name="Assertion.assume_success">falseboolProp> <intProp name="Assertion.test_type">8intProp> ResponseAssertion> <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应文本断言" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="3254239">jackstringProp> collectionProp> <stringProp name="Assertion.custom_message">jack is not returnstringProp> <stringProp name="Assertion.test_field">Assertion.response_datastringProp> <boolProp name="Assertion.assume_success">falseboolProp> <intProp name="Assertion.test_type">2intProp> ResponseAssertion> <hashTree/>  <ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="users聚合报告" enabled="true"> <boolProp name="ResultCollector.error_logging">falseboolProp> <objProp> <name>saveConfigname> <value class="SampleSaveConfiguration"> <time>truetime> <latency>truelatency> <timestamp>truetimestamp> <success>truesuccess> <label>truelabel> <code>truecode> <message>truemessage> <threadName>truethreadName> <dataType>truedataType> <encoding>falseencoding> <assertions>trueassertions> <subresults>truesubresults> <responseData>falseresponseData> <samplerData>falsesamplerData> <xml>falsexml> <fieldNames>truefieldNames> <responseHeaders>falseresponseHeaders> <requestHeaders>falserequestHeaders> <responseDataOnError>falseresponseDataOnError> <saveAssertionResultsFailureMessage>truesaveAssertionResultsFailureMessage> <assertionsResultsToSave>0assertionsResultsToSave> <bytes>truebytes> <sentBytes>truesentBytes> <threadCounts>truethreadCounts> <idleTime>trueidleTime> <connectTime>trueconnectTime> value> objProp> <stringProp name="filename">stringProp> ResultCollector> <hashTree/>  hashTree> <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="user结果树" enabled="true"> <boolProp name="ResultCollector.error_logging">falseboolProp> <objProp> <name>saveConfigname> <value class="SampleSaveConfiguration"> <time>truetime> <latency>truelatency> <timestamp>truetimestamp> <success>truesuccess> <label>truelabel> <code>truecode> <message>truemessage> <threadName>truethreadName> <dataType>truedataType> <encoding>falseencoding> <assertions>trueassertions> <subresults>truesubresults> <responseData>falseresponseData> <samplerData>falsesamplerData> <xml>falsexml> <fieldNames>truefieldNames> <responseHeaders>falseresponseHeaders> <requestHeaders>falserequestHeaders> <responseDataOnError>falseresponseDataOnError> <saveAssertionResultsFailureMessage>truesaveAssertionResultsFailureMessage> <assertionsResultsToSave>0assertionsResultsToSave> <bytes>truebytes> <sentBytes>truesentBytes> <threadCounts>truethreadCounts> <idleTime>trueidleTime> <connectTime>trueconnectTime> value> objProp> <stringProp name="filename">stringProp> ResultCollector> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="login_api" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <collectionProp name="Arguments.arguments"> <elementProp name="name" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">falseboolProp> <stringProp name="Argument.value">jackstringProp> <stringProp name="Argument.metadata">=stringProp> <boolProp name="HTTPArgument.use_equals">trueboolProp> <stringProp name="Argument.name">namestringProp> elementProp> <elementProp name="pwd" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">falseboolProp> <stringProp name="Argument.value">123stringProp> <stringProp name="Argument.metadata">=stringProp> <boolProp name="HTTPArgument.use_equals">trueboolProp> <stringProp name="Argument.name">pwdstringProp> elementProp> collectionProp> elementProp> <stringProp name="HTTPSampler.domain">127.0.01stringProp> <stringProp name="HTTPSampler.port">80stringProp> <stringProp name="HTTPSampler.protocol">stringProp> <stringProp name="HTTPSampler.contentEncoding">stringProp> <stringProp name="HTTPSampler.path">/loginstringProp> <stringProp name="HTTPSampler.method">POSTstringProp> <boolProp name="HTTPSampler.follow_redirects">trueboolProp> <boolProp name="HTTPSampler.auto_redirects">falseboolProp> <boolProp name="HTTPSampler.use_keepalive">trueboolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">trueboolProp> <stringProp name="HTTPSampler.embedded_url_re">stringProp> <stringProp name="HTTPSampler.connect_timeout">stringProp> <stringProp name="HTTPSampler.response_timeout">stringProp> HTTPSamplerProxy> <hashTree/> hashTree> <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="100人" enabled="true"> <stringProp name="ThreadGroup.on_sample_error">continuestringProp> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> <boolProp name="LoopController.continue_forever">falseboolProp> <stringProp name="LoopController.loops">1stringProp> elementProp> <stringProp name="ThreadGroup.num_threads">100stringProp> <stringProp name="ThreadGroup.ramp_time">2stringProp> <boolProp name="ThreadGroup.scheduler">falseboolProp> <stringProp name="ThreadGroup.duration">stringProp> <stringProp name="ThreadGroup.delay">stringProp> SetupThreadGroup> <hashTree/> <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="5人线程组" enabled="true"> <stringProp name="ThreadGroup.on_sample_error">continuestringProp> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> <boolProp name="LoopController.continue_forever">falseboolProp> <stringProp name="LoopController.loops">2stringProp> elementProp> <stringProp name="ThreadGroup.num_threads">5stringProp> <stringProp name="ThreadGroup.ramp_time">2stringProp> <boolProp name="ThreadGroup.scheduler">falseboolProp> <stringProp name="ThreadGroup.duration">stringProp> <stringProp name="ThreadGroup.delay">stringProp> ThreadGroup> <hashTree> <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <collectionProp name="Arguments.arguments"> <elementProp name="name" elementType="Argument"> <stringProp name="Argument.name">namestringProp> <stringProp name="Argument.value">user_onestringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> <elementProp name="pwd" elementType="Argument"> <stringProp name="Argument.name">pwdstringProp> <stringProp name="Argument.value">123stringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> <elementProp name="ip" elementType="Argument"> <stringProp name="Argument.name">ipstringProp> <stringProp name="Argument.value">192.168.96.168stringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> <elementProp name="port" elementType="Argument"> <stringProp name="Argument.name">portstringProp> <stringProp name="Argument.value">80stringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> collectionProp> Arguments> <hashTree/> <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="察看结果树" enabled="true"> <boolProp name="ResultCollector.error_logging">falseboolProp> <objProp> <name>saveConfigname> <value class="SampleSaveConfiguration"> <time>truetime> <latency>truelatency> <timestamp>truetimestamp> <success>truesuccess> <label>truelabel> <code>truecode> <message>truemessage> <threadName>truethreadName> <dataType>truedataType> <encoding>falseencoding> <assertions>trueassertions> <subresults>truesubresults> <responseData>falseresponseData> <samplerData>falsesamplerData> <xml>falsexml> <fieldNames>truefieldNames> <responseHeaders>falseresponseHeaders> <requestHeaders>falserequestHeaders> <responseDataOnError>falseresponseDataOnError> <saveAssertionResultsFailureMessage>truesaveAssertionResultsFailureMessage> <assertionsResultsToSave>0assertionsResultsToSave> <bytes>truebytes> <sentBytes>truesentBytes> <threadCounts>truethreadCounts> <idleTime>trueidleTime> <connectTime>trueconnectTime> value> objProp> <stringProp name="filename">stringProp> ResultCollector> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP请求" 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.168stringProp> <stringProp name="HTTPSampler.port">80stringProp> <stringProp name="HTTPSampler.protocol">stringProp> <stringProp name="HTTPSampler.contentEncoding">stringProp> <stringProp name="HTTPSampler.path">/info?name=${csv_name} "HTTPSampler.method">GET "HTTPSampler.follow_redirects">true "HTTPSampler.auto_redirects">false "HTTPSampler.use_keepalive">true "HTTPSampler.DO_MULTIPART_POST">false "HTTPSampler.embedded_url_re"> "HTTPSampler.connect_timeout"> "HTTPSampler.response_timeout"> HTTPSamplerProxy>  <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV 数据文件设置" enabled="true"> "filename">/Users/jack/Desktop/user.txt "fileEncoding">UTF-8 "variableNames">csv_name "ignoreFirstLine">false "delimiter">| "quotedData">false "recycle">true "stopThread">false "shareMode">shareMode.all CSVDataSet>   <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="3人线程组" enabled="true"> "ThreadGroup.on_sample_error">continue "ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> "LoopController.continue_forever">false "LoopController.loops">2  "ThreadGroup.num_threads">3 "ThreadGroup.ramp_time">2 "ThreadGroup.scheduler">false "ThreadGroup.duration"> "ThreadGroup.delay"> SetupThreadGroup>  <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="用户信息_info_api" enabled="true"> "HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> "Arguments.arguments"/>  "HTTPSampler.domain">${ip} "HTTPSampler.port">${port} "HTTPSampler.protocol"> "HTTPSampler.contentEncoding"> "HTTPSampler.path">/info?name=${csv_name}&pwd=${csv_pwd} "HTTPSampler.method">GET "HTTPSampler.follow_redirects">true "HTTPSampler.auto_redirects">false "HTTPSampler.use_keepalive">true "HTTPSampler.DO_MULTIPART_POST">false "HTTPSampler.embedded_url_re"> "HTTPSampler.connect_timeout"> "HTTPSampler.response_timeout"> HTTPSamplerProxy>  <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="察看结果树" enabled="true"> "ResultCollector.error_logging">false  saveConfig class="SampleSaveConfiguration"> <time>truetime> <latency>truelatency> <timestamp>truetimestamp> <success>truesuccess> <label>truelabel> <code>truecode> <message>truemessage> <threadName>truethreadName> <dataType>truedataType> <encoding>falseencoding> <assertions>trueassertions> <subresults>truesubresults> <responseData>falseresponseData> <samplerData>falsesamplerData> <xml>falsexml> <fieldNames>truefieldNames> <responseHeaders>falseresponseHeaders> <requestHeaders>falserequestHeaders> <responseDataOnError>falseresponseDataOnError> <saveAssertionResultsFailureMessage>truesaveAssertionResultsFailureMessage> <assertionsResultsToSave>0assertionsResultsToSave> <bytes>truebytes> <sentBytes>truesentBytes> <threadCounts>truethreadCounts> <idleTime>trueidleTime> <connectTime>trueconnectTime> value> objProp> <stringProp name="filename">stringProp> ResultCollector> <hashTree/> <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <collectionProp name="Arguments.arguments"> <elementProp name="ip" elementType="Argument"> <stringProp name="Argument.name">ipstringProp> <stringProp name="Argument.value">192.168.96.168stringProp> <stringProp name="Argument.desc">服务器地址stringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> <elementProp name="port" elementType="Argument"> <stringProp name="Argument.name">portstringProp> <stringProp name="Argument.value">80stringProp> <stringProp name="Argument.desc">服务器端口号stringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> <elementProp name="name" elementType="Argument"> <stringProp name="Argument.name">namestringProp> <stringProp name="Argument.value">xxxxxstringProp> <stringProp name="Argument.metadata">=stringProp> elementProp> collectionProp> Arguments> <hashTree/> <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true"> <stringProp name="delimiter">|stringProp> <stringProp name="fileEncoding">stringProp> <stringProp name="filename">/Users/jack/Desktop/user.txtstringProp> <boolProp name="ignoreFirstLine">falseboolProp> <boolProp name="quotedData">falseboolProp> <boolProp name="recycle">trueboolProp> <stringProp name="shareMode">shareMode.allstringProp> <boolProp name="stopThread">falseboolProp> <stringProp name="variableNames">csv_name,csv_pwdstringProp> CSVDataSet> <hashTree/> hashTree> hashTree> hashTree> jmeterTestPlan> 

你可能感兴趣的:(JMeter——jmx脚本文件解析)