jmeter import excel script development

  Testing process, often need performance, automated testing of imported excel, many import script does not support recording function, it can only be obtained by request parameter capture mode, and then developing scripts by hand, since many students may not be practical to import this operational experience, will be very difficult to develop them, this article will detail how to manually developed scripts to import

First, manually import script

  1. First, log into the system using a browser, press F12 to view the HTTP request, here recommend Google browser, you need to click on the Network> XHR, so you can see the current page request needed
    jmeter import excel script development
  2. Click the OK button, the system prompts are being imported
    jmeter import excel script development
  3. Import, the system prompts record already exists, execute and confirm whether the update? Click OK
    jmeter import excel script development
  4. Import is successful, you will be prompted to import success tips, then best to turn off the recording button, to avoid more admission requests
    jmeter import excel script development

  5. 根据抓取到的接口请求,我们知道导入总共涉及到四个接口请求、主要有如下四个
    一. /epm-web/public-access/epm/platform/ipln/upLoadPlan/ipln_af7f60062819467c927862e3d366b936.do 该接口是导入数据之前,系统返回导入数据版本,此时并未导入数据到系统
    二. /epm-web/public-access/epm/platform/ipln/ipln_af7f60062819467c927862e3d366b936.do?checkPlan 该接口是检查当前页面有多少行数据
    三. /epm-web/public-access/epm/platform/ipln/ipln_af7f60062819467c927862e3d366b936.do?deletePlan 该接口用来确认是否覆盖旧数据
    四. /epm-web/public-access/epm/platform/ipln/upLoadPlan/ipln_af7f60062819467c927862e3d366b936.do?upLoadPlan&importType=0&batVersion=null 该接口才是最终导入数据的接口
  6. 经过多次抓包对比发现,本次导入excel接口中没有涉及到参数需要动态变化,也就是不需要对请求的参数值进行参数化,本文主要介绍最后一个导入接口(其它HTTP类型接口可以参考本人专门写的Jmeter HTTP接口案例开发、调试方法),如下图
    jmeter import excel script development
    jmeter import excel script development
    jmeter import excel script development
    jmeter import excel script development
    jmeter import excel script development

二、开发脚本

  1. 首先添加一个HTTP请求接口,输入协议、服务器ip、端口号、方法、接口路径、parameters值
    jmeter import excel script development
  2. 点击File Upload,输入抓取参数Form Data中获取的上传文件名称、参数名称、MIME类型,本次文件名称使用相对路径格式,把导入文件放在data路径下
    jmeter import excel script development
  3. Add HTTP header information manager, Cookie information input page, the header Content-Type not declare other types, you can use the default
    jmeter import excel script development
  4. Click Debug button to return successfully, the normal data into the system
    jmeter import excel script development
    jmeter import excel script development

   If the article help you, you can click in the bottom right corner focus on functionality, welcome to forward, brick, I will continue to introduce articles related to testing, testing technology to share with you, each one original article is carefully written to prevent plagiarism copy , micro-channel public number to this article synchronized platform, facilitate access


QQ technical exchange group: the group please enter this information 51CTO
jmeter import excel script development


Micro-channel two-dimensional code number of public attention:
jmeter import excel script development
after concerns reply performance tests, you can get a shared resource Download

jmeter import excel script development

Guess you like

Origin blog.51cto.com/6183574/2435836