Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If Loop takes time
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi All,

How to make script run at normal speed when "If condition" is inserted in script?

I mean, I have script like:

Code:
If Window("Flight Reservation").Exist then
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
DataTable.Value("Act_Res")="Pass"
Reporter.ReportEvent 0,"Login Details","Valid Values"
else
Dialog("Login").Activate
Dialog("Login").WinButton("Cancel").Click
DataTable.Value("Act_Res")="Fail"
Reporter.ReportEvent 1,"Login Details","Invalid Values"
End If

Now at starting of "IF Condition" it takes 5 seconds or sometimes 10 seconds to check whether window exists.

I dont want QTP to wait for 10 seconds. How to avoid it?

Above I posted sample code but in real time I work on other applications and it has several If loop and my script waits for more time.

How to overcome this wait time and make qtp to execute script at normal time?
Pls help
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi,
Plz use
.Exist(1)

' here 1 is the time in sec. it s timeout period to check if the object appears in that time period. you can put even 0. if you do not mention, it will take default time usualy 60 seconds or so.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP Takes Long time to Run prasaad44 4 4,635 04-10-2014, 01:53 AM
Last Post: prasaad44
  popup window takes a long time bistritapcv 4 3,297 04-17-2013, 09:35 PM
Last Post: bistritapcv
  FOR LOOP shayk1985 1 5,119 12-13-2012, 11:35 AM
Last Post: sams001
  How to exit from a for loop silpavinod 2 9,366 10-17-2012, 12:55 AM
Last Post: agarwl.anurag
  for loop sia sharma 1 3,193 09-13-2012, 11:44 AM
Last Post: ksrikanth2k9

Forum Jump:


Users browsing this thread: 1 Guest(s)