wait从字面意思为等待的意思,中QTP中同样为等待,就在在使用这个wait以后,当脚本执行到这一步的时候将出现时间等待,相比同步点没那么灵活。
以下是wait的格式:WaitSeconds[,Milliseconds]
例如:

blnDone=Window("Flight Reservation").Dialog("Flights Table").Exist

   counter=1

While Not blnDone

    Wait (2)

       blnDone=Window("Flight Reservation").Dialog("Flights Table").Exist

       counter=counter+1

       If counter=10 then

              blnDone=True

       End if

Wend

以下为实例:这是源文件

'Browser("xxxxxxxxxxx 版本号:V4.1.0.2").Page("xxxxxxxxxxx ").Frame("main_center_4").Image("flowButtonLine2").FireEvent "onmouseover"

加入wait后

Dim blnDone

blnDone=Browser("xxxxxxxxxxx 版本号:V4.1.0.2").Page("xxxxxxxxxxx").Frame("main_center_4").Image("flowButtonLine2")

   count=1

   While Not blnDone

 Wait (10)

blnDone= Browser("xxxxxxxxxxx 版本号:V4.1.0.2").Page("xxxxxxxxxxx").Frame("main_center_4").Image("flowButtonLine2")

     count=count+1

       if  count=10  then

              blnDone=True

       end if

   wend

充分利用微博加快社区发展