You may have scripts that are syntactically correct, but which will fail run-time. For example, this could be non-existing question ids as parameter in the f function or trying to set a string value in a numeric question. Often these errors happen only for certain combinations of answers. To be able to test out as many combinations as possible, you can use the Random Data Generator functionality. This is a Forsta add-on. If you do not have access to this functionality, please contact your Forsta account manager for more information.)
The Random Data Generator lets you run a number of automated test interviews with randomly selected responses. All script code in script nodes, masks, conditions, validation code and response piping will be executed, and any script errors will be recorded and listed for inspection at the end of the RDG run.
Figure 1 - Location of errors
The list of errors from the random data generator is clickable, and clicking on the description will open the script, question or info where the error appeared.
In the example above, the problem is that the input to the Math.max method is not a list of numbers. In the code above that method returns NaN (not a number), which makes the script fail when attempting to set the question max, which has the numeric property. A better solution would be to use the Forsta PlusMax function (go to Max and Min for more information), which automatically converts the values to numbers before finding the maximum.
To help debugging you can use the results tab on the questions to see top line results for each question. It is also possible to filter these results so that you see the results only for those that got a particular error by clicking the filter icon in the rightmost column. You can also click the link in the "Test" column to access the first interview that experienced the error.