zoukankan      html  css  js  c++  java
  • Jmeter高阶学习,运用NotePad++编写工程,随意复制多个工程到同一个工程

    Jmeter创建了工程之后,保存文件后就是一个jmx后缀的文件,你有没有试过单独用文本编辑器打开文件,编辑文件?

    Step1: 最简单的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="Test Plan" 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="User Defined Variables" enabled="true">
            <collectionProp name="Arguments.arguments"/>
          </elementProp>
          <stringProp name="TestPlan.user_define_classpath"></stringProp>
        </TestPlan>
        <hashTree/>
      </hashTree>
    </jmeterTestPlan>
    

      Step2: 了解hasetree层级关系

    <?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="Test Plan" 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="User Defined Variables" enabled="true">
            <collectionProp name="Arguments.arguments"/>
          </elementProp>
          <stringProp name="TestPlan.user_define_classpath"></stringProp>
        </TestPlan>
        <hashTree>
          <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="1111111111111" 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/>
        </hashTree>
      </hashTree>
    </jmeterTestPlan>

      

    仔细观察发现多了ThreadGroup 以及两个想对应的hashtree,因为线程组是在测试计划之下的,所以属于下一级。

    感觉就这么简单,可以随意打开各个jmx工程相互拼接了  哈哈哈哈哈^_^

    同一级并列关系的两个元素用<hashtree/>

    下一级有包含关系的两个元素用<hashtree></hashtree>

    快去愉快的copy2paste吧

  • 相关阅读:
    【集训队作业2018】不可名状
    【UTR #3】量子破碎
    【清华集训2016】你的生命已如风中残烛
    【清华集训2016】如何优雅地求和
    玩转大数据系列之Apache Pig高级技能之函数编程(六)
    ElasticSearch入门之彼行我释(四)
    玩转大数据系列之Apache Pig如何与Apache Solr集成(二)
    玩转大数据之Apache Pig如何与Apache Lucene集成
    如何学好一门编程语言或技术?
    2015年春节往事小记
  • 原文地址:https://www.cnblogs.com/qianjinyan/p/9083455.html
Copyright © 2011-2022 走看看