Ok, i got you. Even i have implemented scenarios like this. But this can be solved by creating your own situational based solutions. As far as i know, QTP directly will not help you on this occasion.
In one my projects, the situation was like there was an object which could be at different statuses at different times (one status at a time). The staus used to change after some event occurs to that object. So after making an event happen on that object, the testing need was to wait till the status changes (say from "AAA" to "BBB") or wait for max 5 minutes and if the status doesn't change within 5 mins, make that step fail and proceed next.
I followed the approach below:
----code for necessary event to change the status
Hope you will get an idea now to design your own approach!
In one my projects, the situation was like there was an object which could be at different statuses at different times (one status at a time). The staus used to change after some event occurs to that object. So after making an event happen on that object, the testing need was to wait till the status changes (say from "AAA" to "BBB") or wait for max 5 minutes and if the status doesn't change within 5 mins, make that step fail and proceed next.
I followed the approach below:
----code for necessary event to change the status
Code:
tCounter = 0 \\ Set a time counter to 0
getStatus = Brower("").Page("").WebTable("").GetCellData(row,col) //status was displayed in a particular cell of a webtable
While (getStatus <> "BBB" And tCounter < 5)
Wait(60)
tCounter = tCounter + 1
getStatus = Brower("").Page("").WebTable("").GetCellData(row,col)
Wend
If getStatus <> "BBB" Then
Reporter.ReportEvent micFail,"step","desc"
End If
Hope you will get an idea now to design your own approach!