51Testing软件测试论坛

标题: winrunner求助。 [打印本页]

作者: tiemuzhen    时间: 2006-11-9 13:51
标题: winrunner求助。
昨天刚开始学winrunner,超级新手,提的问题还请不要见笑。

1)怎样编辑tsl脚本,让其判断是否出现某个窗口?(比如要关闭某个软件,会弹出提示是否储存的窗口,如果有多个编辑文件,就要弹出好几次,怎样让winrunner判断是否弹出窗口,然后执行操作?)
2)怎样让winrunner产生报告,让其对以下的操作。用记事本打开一个文件,如果前三个字符是“yyy”就表示成功,如果不是,表示失败。
作者: tiemuzhen    时间: 2006-11-10 09:46
标题: 怎么没高手来帮忙啊?- -!
第一个问题暂时解决了,第二个问题我再说详细点:“用记事本打开一个文件——>判断前三个字符是否是”yyy“——>是就report_msg("yes")否就report_msg("no")”


拜托各位帮帮忙啊!
作者: 小李美刀    时间: 2006-11-10 12:43
标题: do it like this
it is very easy!

The following is what I write manually, it can achieve what you want. hope it help for you.

in the yyy.txt file you can enter any words

file="f:\\yyy.txt";
file_open(file,FO_MODE_READ);
file_getline(file,outvalue);
s=substr(outvalue,0,3);
if(s=="yyy")
report_msg("pass");
else
report_msg("failed");




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2