18 January 2026:


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.

_expectConfirm issue

rj412rj412 Members
edited November -1 in Sahi - Open Source
I am unable to capture the alert/prompt/confirm text to use for _expectConfirm.
The text is not always the same so I can not hardcode the text. I tried wilcard to always hit true but didnt work either.

var $label = _lastConfirm();
_alert("label " + $label); //results: label null
var $label2 = _lastPrompt();
_alert("label2 " + $label2); //results: label2 null
var $label3 = _lastAlert();
_alert("label3 " + $label3); //results: label3 null

_expectConfirm($label, true);
_expectConfirm($label2, true);
_expectConfirm($label3, true);
_expectConfirm("/.*anytext.*/", true);


Please help.
Sign In or Register to comment.