Gatling教程 Gatling 教程三:使用脚本录制功能
      xiuxiuing
       ·
      October 19, 2018
      
         ·
        Last by ElaineSepter replied at March 11, 2020
      
       ·
      6807 hits
    
  
          「All right reserved, any unauthorized reproduction or transfer is prohibitted」
        
      Gatling 提供了可视化的接口录制功能,我们无须写任何代码,通过录制功能可以自动生成性能测试所需要的脚本。
上篇文件如何配置 IntelliJ 的开发环境,本文将谈谈如何使用录制功能。
- 在 IntelliJ 中选择Recorder文件右键运行,即可打开 Gatling 录制的界面,如果不是使用 IntelliJ 来开发,运行/bin/recorder.sh命令也是可以启动录制界面的。 设置完成后,点击 设置完成后,点击start,开始录制。
 
- 在 Firefox 设置中,设置网络代理
  
 
- 使用类似 PostMan 的工具,模拟发送 http 请求
 如果使用的 Https 协议的话,需要添加例外 如果使用的 Https 协议的话,需要添加例外  
 
- Gatling 客户端则会监听到接口请求,接口录制完成后,点击Stop & Save  
 
- 在 IntelliJ 中可以看到录制完后自动生成的脚本
  
由于录制过程中会有我们不需要的请求,可以在脚本中删除。
- 
点击 Engine脚本右键即可运行我们录制的脚本了。com.xiuxiuing.RecordedSimulation is the only simulation, executing it. Select simulation id (default is 'recordedsimulation'). Accepted characters are a-z, A-Z, 0-9, - and _ Select run description (optional) Simulation com.xiuxiuing.RecordedSimulation started...
          TesterHome 为用户提供「保留所有权利,禁止转载」的选项。
          除非获得原作者的单独授权,任何第三方不得转载标注了「All right reserved, any unauthorized reproduction or transfer is prohibitted」的内容,否则均视为侵权。
          具体请参见TesterHome 知识产权保护协议。
  
    如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
  
  

 
        