lf知识星球banner

步骤动作关键字

2020-05-28 17:08:49
Seagull
1741
最后编辑:Seagull 于 2020-05-28 17:10:21
  • 3#Wait 当前步骤暂停3秒,以前写法是3*Wait 现在间隔符由*号变成#,以便后续统一规划。   历史关键字处理,在版本升级的数据库脚本中已经提供相关SQLupdate project_casesteps set action=REPLACE(action,'*','#') where action like "%*wait" or action like "%*Wait" 
  • key[序号]#getJV 获取测试结果中JSON对象中,指定KEY的值,比如测试结果返回:{["name":"张三","age":"18"]["name":"李四","age":"17"]} ,如果想获取李四的年纪 在步骤动作中需要这样写 age[2]#getJV 获取到以后,会拿到17这个值,给预期结果中的关键字进行判断,是匹配,还是赋值都可以。 
  • [startstr][endstr]#subCentreStr 截取测试结果中指定开始字符以及结束字符的中间字符串,比如测试结果返回:{["name":"张三","age":"18"]["name":"李四","age":"17"]} ,如果想获取李四的年纪 在步骤动作中需要这样写 [age":"]["]}]#subCentreStr 获取到以后,会拿到17这个值,给预期结果中的关键字进行判断,是匹配,还是赋值都可以。
  •  [startnum][endnum]#subCentreNum 截取测试结果中指定开始位置以及结束位置的中间字符串,比如测试结果返回:{["name":"张三","age":"18"]["name":"李四","age":"17"]} ,如果想获取李四的年纪 在步骤动作中需要这样写 [45][46]#subCentreNum 获取到以后,会拿到17这个值,给预期结果中的关键字进行判断,是匹配,还是赋值都可以。 
  • [rgex][index]#subStrRgex 通过正则截取测试结果中的字符串,[rgex]在[]中填写正则表达式,[index]在[]中填写匹配到字符串的序号,拿到截取的值以后,给预期结果中的关键字进行判断,是匹配,还是赋值都可以。
评论列表
zz 2020-07-16 17:40:25 回复
请教大佬:
{"code":1,"result":true,"resultDesc":"操作成功","data":[[{"id":1724362872,"lineId":1030,"siteId":3060,"siteName":"testsite","longitude":112.9912500,"latitude":28.1717317,"lineDirection":1,"siteSort":1,"siteDistance":635.41,"siteBigFlag":0,"examineTime":10},{"id":1724362873,"lineId":1030,"siteId":3061,"siteName":"testsite2","longitude":112.9961900,"latitude":28.1680417,"lineDirection":1,"siteSort":2,"siteDistance":661.45,"siteBigFlag":0,"examineTime":5},{"id":1724362874,"lineId":1030,"siteId":3062,"siteName":"testsite3","longitude":112.9968700,"latitude":28.1739533,"lineDirection":1,"siteSort":3,"siteDistance":0.00,"siteBigFlag":0,"examineTime":5}],[{"id":1724362875,"lineId":1030,"siteId":2864,"siteName":"1","longitude":12.0000000,"latitude":12.0000000,"lineDirection":2,"siteSort":1,"siteDistance":0.00,"siteBigFlag":0,"examineTime":0}]],"pageBean":{"pageNo":1,"pageSize":30,"pageDataCount":0,"pageCount":0}}
像这种格式怎么匹配对应的siteName字段
1/1
发表评论
评论通过审核后显示。
付费知识圈