lf知识星球banner

步骤动作关键字

2020-05-28 17:08:49
Seagull
16679
最后编辑: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]在[]中填写匹配到字符串的序号,拿到截取的值以后,给预期结果中的关键字进行判断,是匹配,还是赋值都可以。
评论列表
大大鱼 2023-05-18 10:54:41 回复
正则表达式的使用,正文里给个例子吧
小弟 2021-03-12 18:29:45 回复
{"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和字段
果果 2020-12-14 21:26:18 回复
请问我的截取一直报错这个,怎么解决 2020-12-14 19:00:43:869:ERROR luckyclient.utils.InvokeMethod.callCase(InvokeMethod.java:410) - 调用异常,请查看错误日志!
java.lang.Exception: 客户端本地驱动目录下没有在包名为【luckyclient.driven.SubString】中找到被调用的方法【subCentreNum】,请检查方法名称以及参数个数是否一致!
at luckyclient.utils.InvokeMethod.callCase(InvokeMethod.java:69)
at luckyclient.execution.httpinterface.WebTestCaseDebug.oneCaseDebug(WebTestCaseDebug.java:98)
at luckyclient.execution.WebDebugExecute.main(WebDebugExecute.java:29)
Seagull 2020-12-17 17:48:23 回复
看下参数个数是不是不对啊
小虾米 2020-10-09 16:48:38 回复
请问大佬,截取的返回值要如何匹配?有相关语法吗?
Seagull 2020-10-10 14:00:49 回复
3.2.1章节有详细介绍啊,另外也可以在官网右上角全局搜索一下关键字
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字段
小弟 2021-03-12 18:28:35 回复
同求
xx 2021-09-17 14:59:33 回复
试试 %="siteName":"testsite"
1/1
发表评论
评论通过审核后显示。
付费知识圈