检查点学习笔记

检查点 check point 作用:是验证程序的运行结果是否与预期结果相符

定义:

  1 vuser-run time settings-contentcheck

    这里的设置是为了让vugen检测哪种页面是错误页面,如果被测的web应用没有使用自定义错误页面,这里不用更改,如果使用了自定义的错误页面,这里需要定义,判断页面是否为错误页面,如果是错误页面则提示运行失败

  

2 检查函数

  image check / text check 原理是在上一个请求页面的函数完成后,运行检查函数,在结果页面中搜索指定的图片或关键字

web_custom_request("login_2",
"URL=http://116.228.160.107:8082/API/web/login?action=LG002",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://116.228.160.107:8082/Login.html",
"Snapshot=t122.inf",
"Mode=HTML",
"EncType=application/x-www-form-urlencoded; charset=UTF-8",
"BodyBinary={\"action\":\"LG002\",\"clienttype\":\"web\",\"data\":{\"GoodsID\":\"01e2f2d4011c4a99a766703e100bbff4\",\"GoodsName\":\"浜戜慨闂ㄥ簵鐗\\x88\",\"PentID\":\"1511252182318\",\"serNum\":\"yunxiu\",\"ProductVersion\":\"yunxiukx\",\"YxToken\":\"180330c0df9438ff5f4768904649f426b66511\"},\"extra\":\"\"}",
LAST);

web_image_check("web_image_check",
"alt=not found",
LAST);
web_find("web_find",
"What=页面已经删除",
LAST);

web_reg_find:先注册,后查找,使用时将它放在请求语句的前面

web_reg_find("Fail=NotFound",
"SaveCount=count",
"Text=登录",
LAST);

web_reg_find先注册的优势是脚本能够一边接收server的数据缓冲,一边进行查找,提高了查找的效率

savecount能够记录查询匹配的次数,web_find机制是查找匹配成功就立即返回,不继续查询和记录匹配次数

在vuser run time设置中的 enable image and text check对web_find有效,对 web_reg_find无效

 

posted @ 2018-04-04 11:07  caojuanshu  阅读(197)  评论(0编辑  收藏  举报