Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic wait in QTP
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
I have to chime in here. I have not investigated timers in QTP yet, but I will. The difference between a While loop and a Wait statement is huge in my opinion.

While both options will get the required results, the difference is in the effect on the test system. A While Loop, Bansanth27's code withstanding because he uses a wait statment, will cause 100% CPU utilization during the loop. This may or may not affect your testing but it certainly can if you are waiting on an application that is utilizing resources heavily and can effect your timing of the application or test.

A Wait statment on the other hand is equivalent to the a .NET/VB Thread.sleep(). Your test application will actually go to sleep for the timeframe requested and have zero CPU utilization. I think this will give you better results in the long run if you are actually trying to measure an application performance.

Of course you need to remember there is no way to continue or break out of a wait statment. It will stay in effect for exactly how long you tell it to wait for. Bansanth27's code using a wait in a while gives a real world example of how to utilize the ability of the wait statement releasing resources for other applications as well as give it a conditional out.
Reply


Messages In This Thread
Dynamic wait in QTP - by Hema - 10-07-2009, 05:08 PM
RE: Dynamic wait in QTP - by Saket - 10-07-2009, 05:13 PM
RE: Dynamic wait in QTP - by Hema - 10-07-2009, 06:47 PM
RE: Dynamic wait in QTP - by basanth27 - 10-07-2009, 07:24 PM
RE: Dynamic wait in QTP - by jsknight1969 - 10-07-2009, 08:18 PM
RE: Dynamic wait in QTP - by venkatbatchu - 10-15-2009, 05:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to identify dynamic webtable as unique in QTP? sudheendramurthy 4 18,653 02-23-2016, 06:16 PM
Last Post: vinod123
  What is the procedure to wait after select the webradio group.? Uma 2 3,998 09-29-2011, 02:07 AM
Last Post: Uma
  How to compare Dynamic PDF content via QTP. upadhyay40 0 3,362 12-10-2010, 03:16 PM
Last Post: upadhyay40

Forum Jump:


Users browsing this thread: 4 Guest(s)