18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Confirm / Cancel javascript alert
Hi,
I have an issue in dealing with this kind of javascript alert, the one discribed here: http://sahi.co.in/w/_expectConfirm when clicking in Click for confirm dialog.
Sahi by default acts as if "Ok" was clicked by the user, how can I make Sahi act as if "Cancel" was clicked?
I thought that the _expectConfirm API would do this, but I think that I didn't understood the real purpose of this API.
I just need to click in "Cancel", because I don't want the result of clicking in "Ok".
I'm using Sahi 2011-07-19 in IE9. OS: Win 7.
Thanks!
I have an issue in dealing with this kind of javascript alert, the one discribed here: http://sahi.co.in/w/_expectConfirm when clicking in Click for confirm dialog.
Sahi by default acts as if "Ok" was clicked by the user, how can I make Sahi act as if "Cancel" was clicked?
I thought that the _expectConfirm API would do this, but I think that I didn't understood the real purpose of this API.
I just need to click in "Cancel", because I don't want the result of clicking in "Ok".
I'm using Sahi 2011-07-19 in IE9. OS: Win 7.
Thanks!
Comments
You can use, _expectConfirm("Some question?", false); for Cancel button to be clicked.
Thanks and regards.
The _expectConfirm should be used befero the action that triggers the alert right?
It still doesn't work for me, here is the code:
It always click on Ok.
for the _expectConfirm, you should place the real message on the confirm pop-up.
"Some question?" is just my example.
Thanks! I didn't knew that the massage should be the same of the confirm pop-up. It works fine now