David,
 
Thank you very much for your info. 
 
Ann---
 
 On Sat, 1/21/12, David Whitehouse <[email protected]> wrote:


From: David Whitehouse <[email protected]>
Subject: Re: check for window is disabled
To: [email protected]
Date: Saturday, January 21, 2012, 9:23 PM




Ann, there are several different things that can be done here.  To monitor when 
window A closes you can do a loop that does an if window.exist(x) where x is a 
small number representing how long the exist will wait after the window 
disappears.  A negative result on the if exist will exit the loop.  A positive 
response should be followed by a wait(n) where n is a wait time before the loop 
performs another iteration.  You will need to include some logic to count the 
number of loops to measure the total time in the wait.  That measurement will 
be used to exit the loop if window A does not exit for some reason.  


example:


dim i, j
j=0 'initialize counter
i = 60 '60 seconds max time
do while true
if window.exist(0.1)
wait(1)
j = j + 1 'bump counter
else
exit do
end if
if j > i 'if timer exceeds max time
exit do 'could call an error handling routine here
end if
loop


Another possibility here depends on what follows window a.  The loop above can 
be modified to use an object.WaitForProperty(property) x where property is the 
object property being monitored (cannot be exist) and x is the wait time.  This 
will allow you to ignore window A and monitor the thing which follows.  




On Jan 13, 2012, at 2:51 PM, ann hoang wrote:






Hi all,
  
Do you have any function check for window is disabled.  For example: right 
after we close Window A but it takes very long time to close the Window A.  We 
don't want to use if else or neither wait(x).
Many thanks
 
Ann

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to