Confirm Method (Page Objects)

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Use the Confirm method to get access to a message box that a tested web page shows using the JavaScript confirm function. To learn more, see Handling JavaScript Popups and Browser Dialogs.

Declaration

TestObj.Confirm()

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Result A Confirm 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.

Result Value

The Confirm object that corresponds to a message box that the web page is showing.

If the page is not showing any message boxes, the method will return a stub object and post an error message to the test log. If the Error handling > On error or the Error handling > On object recognition error property is set to Stop test item or Stop project, TestComplete will stop the test run when the error is posted to the test log.

Remarks

To avoid errors when accessing a message box, you can use the WaitConfirm method. Then, use the Exists property of the returned object to check whether it is a stub object or an actual Confirm object.

See Also

WaitConfirm Method (Page Objects)
Handling JavaScript Popups and Browser Dialogs

Highlight search results