2012-09-21 3 views
2

프로젝트에서 각 스레드에 대해 1 값을 전달해야하며 동일한 값이 여러 번 사용됩니다.
JMeter에 옵션이 있습니까? 예를 들어JMeter의 CSV 데이터 설정

는 :

나의 질문은 간단합니다.

스레드 그룹에서 2 개의 스레드와 10 개의 루프 (각 스레드마다 10 개의 루프)를 할당합니다.

내 요구 사항은 첫 번째 스레드의 첫 번째 행 데이터를 사용해야하며 동일한 데이터는 두 번째 스레드에 대해 10 개의 루프와 두 번째 행 데이터에 사용해야하며 동일한 데이터는 10 개의 루프에 사용해야합니다.

예컨대 : CSV 파일에
, 나는 다음과 같이 선언합니다 : 실행시

43 
42 
45 
46 

는, 스레드 1은 항상 43도 10 루프를해야, 스레드 (2) 항상 (42)를해야한다.
테스트 계획에서 단 2 개의 스레드 만 선언하면 45와 46을 사용하지 않아야합니다. 여기

답변

0

당신이 그것을 할 수있는 방법은 다음과 같습니다

Thread Group (2 threads, iteration : 1) 
+-- Debug Sampler with Name : T-${__threadNum}-${__StringFromFile(/Volumes/HD2/csv.csv, line)} 
+-- Loop Controller (Iterations : 10) 
    +-- Debug Sampler to show you get what you need : T-${__threadNum}-DS-${line} 

테스트 계획 : 1.

  • <?xml version="1.0" encoding="UTF-8"?> 
    <jmeterTestPlan version="1.2" properties="2.3" jmeter="2.8-SNAPSHOT.20120923"> 
        <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.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="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">2</stringProp> 
         <stringProp name="ThreadGroup.ramp_time">1</stringProp> 
         <longProp name="ThreadGroup.start_time">1348513661000</longProp> 
         <longProp name="ThreadGroup.end_time">1348513661000</longProp> 
         <boolProp name="ThreadGroup.scheduler">false</boolProp> 
         <stringProp name="ThreadGroup.duration"></stringProp> 
         <stringProp name="ThreadGroup.delay"></stringProp> 
         </ThreadGroup> 
         <hashTree> 
         <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="T-${__threadNum}-${__StringFromFile(/Volumes/HD2/csv.csv, line)}" enabled="true"> 
          <boolProp name="displayJMeterProperties">false</boolProp> 
          <boolProp name="displayJMeterVariables">true</boolProp> 
          <boolProp name="displaySystemProperties">false</boolProp> 
         </DebugSampler> 
         <hashTree/> 
         <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> 
          <boolProp name="LoopController.continue_forever">true</boolProp> 
          <stringProp name="LoopController.loops">10</stringProp> 
         </LoopController> 
         <hashTree> 
          <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="T-${__threadNum}-DS-${line}" enabled="true"> 
          <boolProp name="displayJMeterProperties">false</boolProp> 
          <boolProp name="displayJMeterVariables">true</boolProp> 
          <boolProp name="displaySystemProperties">false</boolProp> 
          </DebugSampler> 
          <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>false</message> 
           <threadName>true</threadName> 
           <dataType>false</dataType> 
           <encoding>false</encoding> 
           <assertions>true</assertions> 
           <subresults>false</subresults> 
           <responseData>false</responseData> 
           <samplerData>false</samplerData> 
           <xml>false</xml> 
           <fieldNames>false</fieldNames> 
           <responseHeaders>false</responseHeaders> 
           <requestHeaders>false</requestHeaders> 
           <responseDataOnError>false</responseDataOnError> 
           <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> 
           <assertionsResultsToSave>0</assertionsResultsToSave> 
           <bytes>true</bytes> 
           <hostname>true</hostname> 
           <threadCounts>true</threadCounts> 
           <sampleCount>true</sampleCount> 
           </value> 
          </objProp> 
          <stringProp name="filename"></stringProp> 
          </ResultCollector> 
          <hashTree/> 
         </hashTree> 
         </hashTree> 
        </hashTree> 
        </hashTree> 
    </jmeterTestPlan> 
    
  • +0

    덕분에 당신의 응답을. 내 질문은 간단 , 스레드 그룹에서 , 나는 2 개 스레드, 10 개 루프 (각 스레드에 대한 10 개 루프) 내의 requirment가 할당 될 것이다, 나는 첫 번째 스레드와 같은 데이터의 첫 번째 행의 데이터를 사용할 수 있어야한다 10 번째 루프에는 두 번째 행 데이터를, 10 번째 루프에는 동일한 데이터를 사용해야합니다. 예 : csv 파일에서 다음과 같이 선언합니다. 43 42 45 46 실행 중에 스레드 1은 스레드 10 개가 43 개라도 스레드 42는 항상 42 개가 필요합니다. 테스트 계획에서 단 2 개의 스레드 만 선언하면 45와 46을 사용해서는 안됩니다. 감사합니다. Sadiq –

    0
    • 설정 thread 그룹 루프 루프의 원하는 번호와 루프 Conroler를 입력 (귀하의 경우 10) 뒤에 CSV 데이터 세트 구성. 공유 모드를 현재 스레드 그룹으로 설정합니다.
    • 는 루프 CONTROLER의 자식으로 HTTP 요청 샘플러를 추가하고 당신이 그것을 가지고 :

    enter image description here