qtp检查webtable中查询结果的按时间的排序
上一篇 /
下一篇 2010-10-02 11:08:57
/ 个人分类:QTP/UFT
51Testing软件测试网WYWzPM8W|假设我们点击查询后,出现查询结果,需要检查结果的排序是否按时间的先后顺序排列51Testing软件测试网8Ck(P+u3_:vjp
intCount=browser(***).page(***).webtable(***).rowcount51Testing软件测试网T$fB&q-tW
for i=2 to intCount-151Testing软件测试网hX2?:D&^8f
[2b+WNr
for j=i+1 to intCount
5\IVD8h5W0date1=browser(***).page(***).webtable(***).getcelldata(i,1)
'B&ouQ^0'假设第一列为我们要检查的时间
1o-D-S8c N dVsyf0date2=browser(***).page(***).webtable(***).getcelldata(j,1)
u7IXn(d
r0if datediff("d",date1,date2)>0 or datediff("d",date1,date2)=051Testing软件测试网?2T_
Cgv
'datediff函数是判断2个日期的相隔的函数,如果date1晚于date2,则为负数,可以用此来检查排序
.J~._6Ke
r0reporter.reporterevent micpass,"时间排序","按时间先后降序排列"51Testing软件测试网M%P0XZ/q t7~
else
8A)^$s#_9ne0L0reporter.reporterevent micpass,"时间排序","没有按按时间先后降序排列"51Testing软件测试网8C$kuZ,~ n
next
'nW3e_-W
S!F0next51Testing软件测试网0r5oq8V5y
51Testing软件测试网XRU8?3ga0V其实还有好多排序,比如以每条结果的标题(汉字)的首字母排序等等,希望大家补充
&}P%M~1TlDv1f0
收藏
举报
TAG:
时间函数
QTP排序