qtp检查webtable中查询结果的按时间的排序

上一篇 / 下一篇  2012-08-20 10:37:45 / 个人分类:QTP

 
摘自论坛......
 
 
假设我们点击查询后,出现查询结果,需要检查结果的排序是否按时间的先后顺序排列51Testing软件测试网u:hQ F'x
intCount=browser(***).page(***).webtable(***).rowcount51Testing软件测试网2z$HO3MH@;ZF:|D H
for 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"AD
date2=browser(***).page(***).webtable(***).getcelldata(j,1)51Testing软件测试网fqj7P#} x
if datediff("d",date1,date2)>0 or datediff("d",date1,date2)=0
a/J/~ o&V&S497267'datediff函数是判断2个日期的相隔的函数,如果date1晚于date2,则为负数,可以用此来检查排序51Testing软件测试网vH9h/P.~!q
reporter.reporterevent micpass,"时间排序","按时间先后降序排列"
^zXM2E+z4} f`(V~$P497267else51Testing软件测试网,]gE3mrC4C3[.s
reporter.reporterevent micpass,"时间排序","没有按按时间先后降序排列"
!D+gW c,^0eLA497267next51Testing软件测试网U i f8@X"C%s*|a6A
next51Testing软件测试网e%GAMr zl|#y#r51Testing软件测试网w@u"pF'W:\n2V&ctHp

其实还有好多排序,比如以每条结果的标题(汉字)的首字母排序等等,希望大家补充


TAG:

 

评分:0

我来说两句

日历

« 2024-04-14  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 9391
  • 日志数: 23
  • 建立时间: 2012-04-12
  • 更新时间: 2012-08-20

RSS订阅

Open Toolbar