APIs used in Debugging Sahi Scripts
abstract
Some APIs are good for debugging Sahi scripts. They are mostly removed once debugging is done.
_debug
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | 7.0.0 | 7.5.0 | 9.0.0 | NA |
Available for modes: Browser | Windows | Java | Android | iOS | SAP
_debug($message)
Arguments
$message | string | Message to write to Sahi console |
Returns
null |
Sahi Pro Flowcharts Action :Debug
Details
Debug messages are written in the Sahi console and not in the playback logs. It is useful when correlating to messages appearing on the Sahi console.
Debug messages are written in the Sahi console and not in the playback logs. It is useful when correlating to messages appearing on the Sahi console.
// Example:
_debug("Current count is " + $i);
_debugToErr
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | 7.0.0 | 7.5.0 | 9.0.0 | NA |
Available for modes: Browser | Windows | Java | Android | iOS | SAP
_debugToErr($message)
Arguments
$message | string | Message to write to Sahi console error stream |
Returns
null |
Sahi Pro Flowcharts Action :Debug To Err
Details
Same as _debug, but prints to the error stream.
Same as _debug, but prints to the error stream.
_debugToFile
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | 7.0.0 | 7.5.0 | 9.0.0 | NA |
Available for modes: Browser | Windows | Java | Android | iOS | SAP
_debugToFile($message, $filePath)
Arguments
$message | string | Message to write to file |
$filePath | string | Path to file. Relative path resolves relative to where Sahi's process is started from.
Path to file. Relative path resolves relative to files folder of the current project. |
Returns
null |
Sahi Pro Flowcharts Action :Debug To File
Details
Prints the message into a file for debugging purposes.
Prints the message into a file for debugging purposes.
_pause
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
5.1.0 | 7.5.0 | 7.5.0 | 9.0.0 | NA |
Available for modes: Browser | Windows | Java | Android | iOS | SAP
_pause()
Arguments
None |
Returns
null |
Sahi Pro Flowcharts Action :Pause
Details
Runs the script till that point and pauses execution. Acts like a debugger breakpoint. Further playback can be controlled from the Controller Playback tab via Step or Play buttons.
Runs the script till that point and pauses execution. Acts like a debugger breakpoint. Further playback can be controlled from the Controller Playback tab via Step or Play buttons.
warningDO NOT leave this in a production script, since it needs user input to proceed and will halt execution
_alert
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_alert($message)
Arguments
$message | string | Message to be alerted on browser. |
Returns
null |
Sahi Pro Flowcharts Action :Alert
Details
Alerts the message on the browser. This allows a very handy, interactive way of debugging scripts.
Alerts the message on the browser. This allows a very handy, interactive way of debugging scripts.
//Example:
_alert("Current count is " + $i);
warningDO NOT leave this in a production script, since it needs user input to proceed and will halt execution
_confirm
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_confirm($message)
Arguments
$message | string | Message to confirm |
Returns
null |
Sahi Pro Flowcharts Action :Confirm
Details
Brings up a javascript confirm dialog with given message. Use only while debugging.
Brings up a javascript confirm dialog with given message. Use only while debugging.
_prompt
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_prompt($message)
Arguments
$message | string | Message to prompt |
Returns
null |
Sahi Pro Flowcharts Action :Prompt
Details
Brings up a javascript prompt with given message. Use only while debugging.
Brings up a javascript prompt with given message. Use only while debugging.
_highlight
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | 7.0.0 | 7.5.0 | 9.0.0 | NA |
Available for modes: Browser | Windows | Java | Android | iOS | SAP
_highlight($element)
Arguments
$element | HTML DOM element | Element to highlight |
Returns
null |
Sahi Pro Flowcharts Action :Highlight
Details
Highlights an element with a red border. Used for debugging purposes.
Highlights an element with a red border. Used for debugging purposes.