QTP 同步点原理

上一篇 / 下一篇  2010-02-07 18:11:39 / 个人分类:QTP

大家先看下面一行用QTP录制的synchronization point代码:

 Window("Flight Reservation").WinButton("Update Order").WaitProperty "enabled", true, 10000

实际上这段源代码可以用下面的伪代码表示:

value= Window("Flight Reservation").WinButton("Update Order").GetROProperty("enabled")

 count=1

 while not (value=true)

      wait(1)

     value= Window("Flight Reservation").WinButton("Update Order").GetROProperty("enabled")

      count=count+1

       if(count=10) then

             break

        end if

 wend

这里QTP每1秒进行检查,直到检查10后退出检查

但需要注意的一点是千万不要以为10s后系统就执行下一条语句,因为QTP中还有一个全局等待时间,即执行每条代码时的最长等待时间。我们可以在file->test settings->run中看到这个时间的设置,系统默认设为20s

所以总超时时间=全局等待时间+同步点超时时间=30s


TAG: 同步点 point QTP synchronization

 

评分:0

我来说两句

日历

« 2024-04-29  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 6534
  • 日志数: 8
  • 建立时间: 2010-01-20
  • 更新时间: 2010-04-01

RSS订阅

Open Toolbar