Description
The Browser.WaitBrowserWindow
method instructs TestComplete to wait until the specified browser window exists in the system or until the timeout is reached.
You typically use this method in combination with the Exists
property to check if a specific browser window exists. See Checking Whether an Object Exists.
Note: | The Browser.WaitBrowserWindow method is usually used in scripted tests that do not use Name Mapping. In keyword tests, you can define a custom object waiting timeout directly for browser window operations using the Set Auto-Wait Timeout for Operations command of the context menu. You can also use the If Object keyword test operation to check if a specific browser window is opened. |
Declaration
TestObj.WaitBrowserWindow(ObjectIdentifier, Timeout)
TestObj | A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section | |||
ObjectIdentifier | [in] | Required | Integer | |
Timeout | [in] | Optional | Integer | Default value: 0 |
Result | A BrowserWindow object |
Applies To
The method is applied to the following object:
View Mode
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
Parameters
The method has the following parameters:
ObjectIdentifier
A zero-based index of the browser window among all windows opened in the browser. The first browser window has the index of 0, the second - 1, and so on.
Timeout
The time, in milliseconds, to wait for the browser window to become available. If Timeout is 0, the method searches for the specified browser window once and then returns immediately. If Timeout is -1, the waiting time is infinite.
Result Value
If the specified browser window was found, the method returns the corresponding BrowserWindow
object.
If the browser window was not found during the timeout, the method returns a stub object with the Exists
property equal to False. So, you can check the Exists
property of the returned object to see whether the browser window was found.
Remarks
Unlike the BrowserWindow
method, WaitBrowserWindow
does not post an error message to the test log if the specified browser window was not found. To check whether the browser window was found, examine the Exists
property of the returned object.
See Also
BrowserWindow Object
BrowserWindow Method
Classic Web Testing
Understanding Web Object Identification and Object Models
Checking Whether an Object Exists
Waiting for an Object, Process or Window Activation