Setup and Teardown Thread Group in Jmeter

Reference

testingjournals

Setup Thread Group

It is a special form of Thread Group used to perform necessary actions before execution of regular thread group starts. Behavior of threads mentioned under Setup Thread Group is exactly same as normal thread group.Jmeter automatically triggers Setup Thread group before normal one.

Setup and Teardown Thread Group in Jmeter_第1张图片
Example
  • Import amount of Data from Database and store them into variables.
  • Create / Register multiple users to be used in Test Thread Group.


Teardown Thread Group

It is a special form of Thread Group used to perform necessary actions after the execution of regular thread group completes. Behavior of threads mentioned under Setup Thread Group is exactly same as normal thread group.

Setup and Teardown Thread Group in Jmeter_第2张图片

Example
  • Delete Users which were created in beginning of the test.
NOTE

By default, TearDown Thread Group won’t run if the Test is completed as expected. If you want to run it anyway, mark the check-box “Run tearDown Thread Groups after shutdown of main threads” from Test Plan element.


Code



  
    
      
      false
      false
      
        
      
      
      true
    
    
      
        continue
        
          false
          1
        
        1
        1
        1493222349000
        1493222349000
        false
        
        
      
      
        
          
            
          
          www.zhibo8.cc
          
          
          
          
          
          
          GET
          true
          false
          true
          false
          false
          
        
        
      
      
        continue
        
          false
          1
        
        1
        1
        1493223159000
        1493223159000
        false
        
        
      
      
        
          
            
          
          www.sina.com
          
          
          
          
          
          
          GET
          true
          false
          true
          false
          false
          
        
        
      
      
        continue
        
          false
          1
        
        1
        1
        1493223163000
        1493223163000
        false
        
        
      
      
        
          
            
          
          www.baidu.com
          
          
          
          
          
          
          GET
          true
          false
          true
          false
          false
          
        
        
      
      
        false
        
          saveConfig
          
            
            true
            true
            true
            
            true
            true
            true
            true
            false
            true
            true
            false
            false
            true
            true
            false
            false
            false
            true
            0
            true
            true
            true
            true
            true
          
        
        
      
      
    
  



你可能感兴趣的:(Setup and Teardown Thread Group in Jmeter)