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 ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.57.0.07.5.09.0.0NA

Available for modes: Browser | Windows | Java | Android | iOS | SAP

_debug($message)

Arguments
$messagestring 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.
// Example:

_debug("Current count is " + $i);


_debugToErr

Since: Sahi ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.57.0.07.5.09.0.0NA

Available for modes: Browser | Windows | Java | Android | iOS | SAP

_debugToErr($message)

Arguments
$messagestring 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.


_debugToFile

Since: Sahi ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.57.0.07.5.09.0.0NA

Available for modes: Browser | Windows | Java | Android | iOS | SAP

_debugToFile($message, $filePath)

Arguments
$messagestring Message to write to file
$filePathstring
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.


_pause

Since: Sahi ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
5.1.07.5.07.5.09.0.0NA

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.
warningDO NOT leave this in a production script, since it needs user input to proceed and will halt execution


_alert

Since: Sahi ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.5NANANANA

Available for modes: Browser

_alert($message)

Arguments
$messagestring 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.
//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 ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.5NANANANA

Available for modes: Browser

_confirm($message)

Arguments
$messagestring Message to confirm

Returns
null

Sahi Pro Flowcharts Action :Confirm

Details

Brings up a javascript confirm dialog with given message. Use only while debugging.


_prompt

Since: Sahi ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.5NANANANA

Available for modes: Browser

_prompt($message)

Arguments
$messagestring Message to prompt

Returns
null

Sahi Pro Flowcharts Action :Prompt

Details

Brings up a javascript prompt with given message. Use only while debugging.


_highlight

Since: Sahi ProDesktop Add-OnMobile Add-OnSAP Add-OnAI Assist Add-On
3.57.0.07.5.09.0.0NA

Available for modes: Browser | Windows | Java | Android | iOS | SAP

_highlight($element)

Arguments
$elementHTML DOM element Element to highlight

Returns
null

Sahi Pro Flowcharts Action :Highlight

Details

Highlights an element with a red border. Used for debugging purposes.