51Testing软件测试论坛
标题:
如何写语法判断文本检查已经成功或者失败?
[打印本页]
作者:
txs00
时间:
2012-8-3 15:37
标题:
如何写语法判断文本检查已经成功或者失败?
如何写语法判断文本检查已经成功?
代码部分如下:
web_url("report.jsp",
"URL=http://192.168.1.151:8680/QZFM/js/report/report.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.151:8680/QZFM/app/app.jsp",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"Url=flash/open-flash-chart.swf", ENDITEM,
"Url=/QZFM/servlet/ReportServlet", "Referer=http://192.168.1.151:8680/QZFM/js/report/flash/open-flash-chart.swf", ENDITEM,
LAST);
web_find("Text Check", "What=今日共有", LAST);
作者:
txs00
时间:
2012-8-3 16:30
回复
1#
txs00
高手帮菜鸟解答下
作者:
xxl1989
时间:
2012-8-3 16:39
用lr_output_message输出?
作者:
txs00
时间:
2012-8-3 16:56
回复
3#
xxl1989
可否留下代码范例?
作者:
xxl1989
时间:
2012-8-3 17:23
lr_output_message(“ok? %s”,lr_eval_string(“{Text Check}”));
可以写个if else语句这样输出更明显
作者:
thirfing
时间:
2012-8-3 19:28
查看回放日志,一目了然
作者:
shigui3615
时间:
2012-8-6 14:04
脚本改成下面这样
web_reg_find("Text=今日共有",
"SaveCount=Find_Count",
LAST);
web_url("report.jsp",
"URL=http://192.168.1.151:8680/QZFM/js/report/report.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.151:8680/QZFM/app/app.jsp",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"Url=flash/open-flash-chart.swf", ENDITEM,
"Url=/QZFM/servlet/ReportServlet", "Referer=http://192.168.1.151:8680/QZFM/js/report/flash/open-flash-chart.swf", ENDITEM,
LAST);
//web_find("Text Check", "What=今日共有", LAST);
if(atoi(lr_eval_string("{Find_Count}")) > 0) //判断如果 今日共有 字符串出现次数大于0
lr_output_message("Successful."); //在日志中输出Successful
else //如果出现次数小于等于
lr_output_message("Failed."): //在日志中输出Failed
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2