Sunday, April 22, 2012

QTP Timeout Setting

QTP has several timeout out settings, some of which can be defined both through the QTP IDE and/or using vbScript program statements. Some of these timeouts are defined in milliseconds, tenths of a second, seconds or a combination of these values. Furthermore when there is both a IDE setting and a program function, the names for the setting are often different. This posting (hopefully) correctly lists all.

1. Object Sync Timeout is the time that QTP waits for an object to come into existence:

IDE Setting: Test Settings, Run Tab, the “Object Synchronization timeout:” setting. In version 8.x this value is specified in milliseconds and in version 9.x it is specified in seconds (Mercury just wanted to keep us on our toes, huh?)

Program Setting: Setting(“DefaultTimeout”) [=milliseconds] ‘in both 8.x and 9.x

2. Browser Navigation Timeout is defined as “sets the maximum time (in seconds) that QuickTest waits for a Web page to load before running a step in the test”. So how does this differ from and/or interact with the Object Sync Timeout setting? Mercury isn’t saying, so I guess we all need to experiment when testing a pokey web app. Anyway this setting is specified as follows:

IDE Setting: Test Settings, Web tab, “Browser navigation timeout:” X “seconds”

Program Setting: none that I can find, but it seems likely there is one (anyone?)

3. Default Load Time is described in QTP help as “Instructs QuickTest to add a specified number of seconds to the page load time property specified in each Page checkpoint” (for the IDE setting) and as “Indicates the time to add, in seconds, to the load time during recording” (for its programmatic counterpart). Confused? I sure am. Added to what? Perhaps Browser Navigation Timeout? Here again, Mercury is not saying. As per the IDE setting, appears to only be relevant for web applications—-but then how do I achieve the same thing for say a new screen load in my .NET app? (I believe the answer to this rhetorical question is: uses Object Sync Timeout). Anyway this setting is specified as follows:

IDE Setting: Options, Web Tab, “Add” x “seconds to page load time”

Program Setting: Setting(“DefaultLoadTime”) [=seconds]

4. Activate Window is described as “specifies the time (in tenths of a second) that QuickTest waits before it sets the focus on an application window when using the pointing hand to point to an object in the application (for Object Spy, checkpoints, Step Generator, Recovery Scenario Wizard, and so forth)”. I have never changed the default for this setting, which defined as 5 tenths of a second. I guess Mercury thought the mixing of seconds and milleseconds all over the place was not confusing enough, so here we have a tenths of a second setting.

IDE Setting: Options, General tab, “When pointing at a window, activate it after” X “tenths of a second”

Program Setting: none that I am aware of

5. The .Exists(Timeout) function is specified in milliseconds.

6. The .WaitProperty(x, y, Timeout) function is specified in milliseconds.

7. The Wait seconds [, milliseconds] subroutine is specified in both seconds and an optional milliseconds arg, but why? The first arg, seconds, can be specified as 0.250 or whatnot to get a millisecond wait, so you only really need the first arg.

No doubt this list is incomplete. So I hope others will reply and fill in the gaps.

P.S. Even though the QTP Online [un?]Help indicates that the .Exist timeout is set in milliseconds, my very recent impirical debugging seems to indicate that this value is really set in seconds

No comments: