Within Open Bee™ Scan Capture, you have the ability to validate your script’s code by running it using the built-in debugger

Warning: this debugger will only work to test pure Javascript code, if your script contains pre-built Capture variables or references to an index value e.g.:
return DOCUMENT_STATE
or
return getTextFromIndexInfo(getFirstIndexFromID(pParameters, "ID_INDEX"))
Indeed, these values require the script to be linked to a document when it is executed, but during your test no document is attached to it, so these values will be skewed and the proposed result will not be correct