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.
Make use of _pause() in Sahiscript
Hello,
in the JS console of Firefox debugger I can use _sahi.pause() to temporarily prevent SahiPlayer from sending status messages (POST: Player _getCurrentStep). _sahi.unpause() starts this again.
I have to write a special sahi check where some user interaction with the web site is neccessary. I found out that as long SahiPlayer is sending its status messages, some characters of the user's input get lost; they do not as soon as I execute pause(). (-> busy JS engine?)
I am wondering if executing pause() is also possible from sahi script? Would be great!
Thanks a lot, kind regards -
Simmerl
in the JS console of Firefox debugger I can use _sahi.pause() to temporarily prevent SahiPlayer from sending status messages (POST: Player _getCurrentStep). _sahi.unpause() starts this again.
I have to write a special sahi check where some user interaction with the web site is neccessary. I found out that as long SahiPlayer is sending its status messages, some characters of the user's input get lost; they do not as soon as I execute pause(). (-> busy JS engine?)
I am wondering if executing pause() is also possible from sahi script? Would be great!
Thanks a lot, kind regards -
Simmerl
Answers
While alert is on the web page, I go to Sahi Controler and press "Pause." than I return to the alert and confirm it.
Than I can go to the web page and interact with it manualy.
At the end of interaction I again go to Sahi Controler and press "Play" - and script continues.
But when through testrunner.bat I suggest using this code in the script:
var $process = java.lang.Runtime.getRuntime().exec("... notepad.exe Instructions_to_user_for_example.txt ...");
var $status = process.waitFor();
While notepad with instruction is on - user can interact with web page.
At the end user can even write result to notepad an close it.
After waitFor() script continues in web page automation and you can read user input from TXT file.
Other scenario is, when you want break the script and get only some input from user - captcha for example or only a confirmation - and continue with script scenario. In this situation I use this functions:
//<browser>
function BrowserConfirm(message){
_sahi_temp_confirmValue = _sahi._confirm(message);
}
Sahi.prototype._confirm = function (s) {
return this.callFunction(this.real_confirm, window, s);
};
//</browser>
function UserConfirm($message){
var $value = null;
_call(BrowserConfirm($message));
_set($value, _sahi_temp_confirmValue);
return $value;
}
//<browser>
function BrowserInput(data){
_sahi_temp_promptValue = _sahi._prompt(data);
}
//</browser>
function UserInput($data){
var $value = null;
_call(BrowserInput($data));
_set($value, _sahi_temp_promptValue);
return $value;
}