Jmeter学习之While Controller

发表于:2018-10-29 11:05

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:hiv    来源:博客园

分享:
  脚本
  <?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="while" 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>
  <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
  <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  <boolProp name="LoopController.continue_forever">false</boolProp>
  <stringProp name="LoopController.loops">1</stringProp>
  </elementProp>
  <stringProp name="ThreadGroup.num_threads">1</stringProp>
  <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  <boolProp name="ThreadGroup.scheduler">false</boolProp>
  <stringProp name="ThreadGroup.duration"></stringProp>
  <stringProp name="ThreadGroup.delay"></stringProp>
  </ThreadGroup>
  <hashTree>
  <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="sogo" enabled="true">
  <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  <collectionProp name="Arguments.arguments"/>
  </elementProp>
  <stringProp name="HTTPSampler.domain">www.sogo.com</stringProp>
  <stringProp name="HTTPSampler.port">443</stringProp>
  <stringProp name="HTTPSampler.protocol">https</stringProp>
  <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  <stringProp name="HTTPSampler.path">/</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>
  <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>
  <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="sogo_status_code" enabled="true">
  <stringProp name="RegexExtractor.useHeaders">true</stringProp>
  <stringProp name="RegexExtractor.refname">sogoStatusCode</stringProp>
  <stringProp name="RegexExtractor.regex">HTTP/1.1 (.+?) OK</stringProp>
  <stringProp name="RegexExtractor.template">$1$</stringProp>
  <stringProp name="RegexExtractor.default"></stringProp>
  <stringProp name="RegexExtractor.match_number">1</stringProp>
  </RegexExtractor>
  <hashTree/>
  </hashTree>
  <IfController guiclass="IfControllerPanel" testclass="IfController" testname="if_sogo_status_code_ok" enabled="true">
  <stringProp name="IfController.condition">${sogoStatusCode}==&quot;200&quot;</stringProp>
  <boolProp name="IfController.evaluateAll">false</boolProp>
  </IfController>
  <hashTree>
  <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="while_cnblog_status_code_not_ok" enabled="true">
  <stringProp name="WhileController.condition">LAST</stringProp>
  </WhileController>
  <hashTree>
  <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="cnblogs" enabled="true">
  <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  <collectionProp name="Arguments.arguments"/>
  </elementProp>
  <stringProp name="HTTPSampler.domain">www.cnblogs.com</stringProp>
  <stringProp name="HTTPSampler.port">443</stringProp>
  <stringProp name="HTTPSampler.protocol">https</stringProp>
  <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  <stringProp name="HTTPSampler.path">/</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>
  <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>
  <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  <collectionProp name="Asserion.test_strings">
  <stringProp name="49586">200</stringProp>
  </collectionProp>
  <stringProp name="Assertion.custom_message"></stringProp>
  <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
  <boolProp name="Assertion.assume_success">false</boolProp>
  <intProp name="Assertion.test_type">12</intProp>
  </ResponseAssertion>
  <hashTree/>
  </hashTree>
  </hashTree>
  </hashTree>
  <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" 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/>
  </hashTree>
  </hashTree>
  </hashTree>
  </jmeterTestPlan>
  上文内容不用于商业目的,如涉及知识产权问题,请权利人联系博为峰小编(021-64471599-8017),我们将立即处理。
22/2<12
精选软件测试好文,快来阅读吧~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号