Skip to Content

Welcome to theĀ 

Sahi Pro Customer Portal

Access your tickets, forums, courses and more, all in one single place

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
53 Views
Hi,

In my application, I have a JavaScript confirmation pop-up. By default, it automatically clicks OK.

I want to test and verify the Cancel behavior.

Please help me resolve this issue.

Thank you.
Avatar
Discard
Hi Allen,

Please make use of the _expectConfirm() API to confirm or cancel the confirmation.

Ex:

// To click Cancel, use
_expectConfirm("/question/", false); // Tell Sahi to press Cancel for dialog with message containing "question"
_click(_button("Click For Confirm")); // Invoke the dialog
// Sahi would click on Cancel now

Please refer to the documentation link for more information.

https://resources.sahipro.com/docs/sahi-apis/javascript-dialogs.html#_expectConfirm

Regards

Sairam

Avatar
Discard