qtp检查webtable中查询结果的按时间的排序
上一篇 /
下一篇 2012-08-20 10:37:45
/ 个人分类:QTP
摘自论坛......
假设我们点击查询后,出现查询结果,需要检查结果的排序是否按时间的先后顺序排列
51Testing软件测试网u:hQ F'xintCount=browser(***).page(***).webtable(***).rowcount
51Testing软件测试网2z$HO3MH@;ZF:|D Hfor i=2 to intCount-1
h,N-Q3FmnJ!e497267for j=i+1 to intCount
B0X"Zy}H+j F3s1B0qx497267date1=browser(***).page(***).webtable(***).getcelldata(i,1)
51Testing软件测试网*nzG S W9~'假设第一列为我们要检查的时间
51Testing软件测试网yz}0n,GQm2j"ADdate2=browser(***).page(***).webtable(***).getcelldata(j,1)
51Testing软件测试网fqj7P#} xif datediff("d",date1,date2)>0 or datediff("d",date1,date2)=0
a/J/~ o&V&S497267'datediff函数是判断2个日期的相隔的函数,如果date1晚于date2,则为负数,可以用此来检查排序
51Testing软件测试网vH9h/P.~!qreporter.reporterevent micpass,"时间排序","按时间先后降序排列"
^zXM2E+z4} f`(V~$P497267else
51Testing软件测试网,]gE3mrC4C3[.sreporter.reporterevent micpass,"时间排序","没有按按时间先后降序排列"
!D+gW c,^0eLA497267next
51Testing软件测试网Ui f8@X"C%s*|a6Anext
51Testing软件测试网e%GAMr zl|#y#r51Testing软件测试网w@u"pF'W:\n2V&ctHp其实还有好多排序,比如以每条结果的标题(汉字)的首字母排序等等,希望大家补充
收藏
举报
TAG: