WaitForReady Method

Class

WaitForReady is declared for the browser window.

Action

Waits the specified amount of time for the browser to become ready. The WaitForReady method is needed only before Browser or BrowserChild methods are called.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

rSeconds = object.WaitForReady ([rTimeout])
Variable Description
rSeconds The number of seconds the application took to be ready. REAL.
rTimeout Optional. The number of seconds to wait. If not specified, uses the value set in OPT_APPREADY_TIMEOUT. REAL.

Notes

The browser is considered ready when all of the components in the page have been downloaded. Note that the WaitForReady method is needed only before Browser or BrowserChild methods are called. All methods on HTML classes automatically wait for the document to be completely downloaded.

Although Browser.WaitForReady() waits for page components to be downloaded, it does not necessarily wait for them to be rendered. Therefore if your page is slow to render (for example, due to slow JavaScript execution) and you receive Window not found exceptions, it is recommended that you call w.Exists(n) before trying to manipulate objects on the page, where w is a slow-loading object on the page, and n is a timeout at least as long as it should ever take to load that object. Note that w.Exists(n) will return when w is detected, even if that is long before the timeout specified by n, so there is no penalty in setting a large n unless w is never actually rendered.

Do not set the timeout lower than 3. If you set the timeout too low, then Silk Test Classic will not raise an exception. If you need to enforce a short timeout for the browser to become ready, then check the return value (rSeconds) and raise an exception if it is too large.

Example

BrowserPage.HtmlLink{"Go to next page").Click()
Browser.WaitForReady()
ResPrintList ("Links on page '{BrowserPage.GetCaption ()}'", BrowserPage.GetLinks ())