遇一山,过一山,处处有风景;只要勇敢向前,一路尽是繁花盛开。 | (点击查看→)【测试干货】python/java自动化、持续集成、性能、测开、简历、笔试面试等

jmeter关联练习题(正则、jsonpath)--能做出来,关联就基本没问题了

 

练习一:获取“接口”二字前面的那个value值

说明:“接口”二字在响应中只出现一次

也就是获取

 

option个数、位置都固定,获取“接口”二字前面的value值

<option value="8a818111754a4e0c01754f87c94d0071">https://www.cnblogs.com/uncleyong</option>         <option value="8a8181117738a88f0177390675e001d7">接口测试-阿里直播设置域名编辑后.com</option>        </select>
                        </div>
                    </div>

 

option个数、位置都不固定,获取“接口”二字前面的value值

可能是下面多种情况

比如:位置不固定

<option value="8a8181117738a88f0177390675e001d7">接口测试-阿里直播设置域名编辑后.com</option>    <option value="8a818111754a4e0c01754f87c94d0071">https://www.cnblogs.com/uncleyong</option>                 </select>
                        </div>
                    </div>

也可能是:option个数不固定

<option value="8a818111754a4e0c01754f87c94d0071">https://www.cnblogs.com/uncleyong</option>         <option value="8a8181117738a88f0177390675e001d7">接口测试-阿里直播设置域名编辑后.com</option>     <option value="01754f87c94d00718a818111754a4e0c">www.baidu.com</option>   </select>
                        </div>
                    </div>

 

  

练习二:获取showname为“全栈测试笔记”的uuid

说明:showname个数、位置都不确定;至少两种方法实现

{"code":20000,"msg":"成功","data":{"count":34,"next":"http://***.***-vip.cn/admin_api/v1/consultant/?page=2","previous":null,"results":[{"uuid":"PjYW29qsY9xkWt2pxuYpb8","showname":"超级用户","mobile":"18888888888","level":4,"is_tmk":1,"group":"销售组001,销售组002,销售组006,xm1销售组1,测试简化,测试简化222222,考研潜在客户组,考研TMK二电"},{"uuid":"CuvM58cudnKYZcuoNVSPSQ","showname":"测试01","mobile":"18111111111","level":4,"is_tmk":1,"group":"销售组001,销售组002,销售组006,xm1销售组1,测试简化,测试简化222222,考研潜在客户组"},{"uuid":"sbSvXLB8vQS6GPNEESqfAg","showname":"测试02","mobile":"19999999999","level":4,"is_tmk":1,"group":"销售组001,销售组002,销售组006,xm1销售组1,xm1销售组2,测试简化,测试简化222222"},{"uuid":"h2yfwgkLmebqAnMvaBBRa4","showname":"测试03","mobile":"17352410310","level":2,"is_tmk":1,"group":"销售组001,销售组002,xm1销售组1,xm1销售组2,测试简化,测试简化222222"},{"uuid":"baJsmR2uVeDA79jbg8Eja6","showname":"测试01","mobile":"18662466691","level":1,"is_tmk":1,"group":"销售组001,销售组002"},{"uuid":"mVmVANpQbrbVmmWghHfSqN","showname":"测试04","mobile":"18860916422","level":1,"is_tmk":0,"group":"销售组001,销售组002,销售组006,xm1销售组1,xm1销售组2"},{"uuid":"qvSAeRif9ps56k7fJvTFCn","showname":"测试05","mobile":"15751595832","level":1,"is_tmk":0,"group":"销售组001,销售组002,销售组006,xm1销售组1,xm1销售组2,测试简化,测试简化222222"},{"uuid":"uNkh2t4MiHZt5Pk9KtNatL","showname":"全栈测试笔记","mobile":"13776238213","level":1,"is_tmk":0,"group":"销售组001,考研TMK二电"}]}}

  

格式化数据

{
  "code": 20000,
  "msg": "成功",
  "data": {
    "count": 34,
    "next": "http://***.***-vip.cn/admin_api/v1/consultant/?page=2",
    "previous": null,
    "results": [
      {
        "uuid": "PjYW29qsY9xkWt2pxuYpb8",
        "showname": "超级用户",
        "mobile": "18888888888",
        "level": 4,
        "is_tmk": 1,
        "group": "销售组001,销售组002,销售组006,xm1销售组1,测试简化,测试简化222222,考研潜在客户组,考研TMK二电"
      },
      {
        "uuid": "CuvM58cudnKYZcuoNVSPSQ",
        "showname": "测试01",
        "mobile": "18111111111",
        "level": 4,
        "is_tmk": 1,
        "group": "销售组001,销售组002,销售组006,xm1销售组1,测试简化,测试简化222222,考研潜在客户组"
      },
      {
        "uuid": "sbSvXLB8vQS6GPNEESqfAg",
        "showname": "测试02",
        "mobile": "19999999999",
        "level": 4,
        "is_tmk": 1,
        "group": "销售组001,销售组002,销售组006,xm1销售组1,xm1销售组2,测试简化,测试简化222222"
      },
      {
        "uuid": "h2yfwgkLmebqAnMvaBBRa4",
        "showname": "测试03",
        "mobile": "17352410310",
        "level": 2,
        "is_tmk": 1,
        "group": "销售组001,销售组002,xm1销售组1,xm1销售组2,测试简化,测试简化222222"
      },
      {
        "uuid": "baJsmR2uVeDA79jbg8Eja6",
        "showname": "测试01",
        "mobile": "18662466691",
        "level": 1,
        "is_tmk": 1,
        "group": "销售组001,销售组002"
      },
      {
        "uuid": "mVmVANpQbrbVmmWghHfSqN",
        "showname": "测试04",
        "mobile": "18860916422",
        "level": 1,
        "is_tmk": 0,
        "group": "销售组001,销售组002,销售组006,xm1销售组1,xm1销售组2"
      },
      {
        "uuid": "qvSAeRif9ps56k7fJvTFCn",
        "showname": "测试05",
        "mobile": "15751595832",
        "level": 1,
        "is_tmk": 0,
        "group": "销售组001,销售组002,销售组006,xm1销售组1,xm1销售组2,测试简化,测试简化222222"
      },
      {
        "uuid": "uNkh2t4MiHZt5Pk9KtNatL",
        "showname": "全栈测试笔记",
        "mobile": "13776238213",
        "level": 1,
        "is_tmk": 0,
        "group": "销售组001,考研TMK二电"
      }
    ]
  }
}

  

【bak】

 

最新原文:https://www.cnblogs.com/uncleyong/p/14329139.html

 

posted @ 2021-01-26 10:52  全栈测试笔记  阅读(2266)  评论(0编辑  收藏  举报
浏览器标题切换
浏览器标题切换end