Debugging MScript

Often times you may need to step through MScript and see how each line of MScript does to AUT.

You can pause the execution at any MScript and advance the execution one MScript line at a time. While execution is paused, you can then examine the AUT and even execution some ad-hoc MScript to help debug any issues you may have.

There are several ways you can step through MScript as described in the following sections.

Set Breakpoints

You can set breakpoint on a specific MScript line or on a state or transition.

To set a breakpoint at a specific MScript, open the MScript for the model by right mouse clicking on the Model node and selecting MScript. MScript should be displayed in the mScriptEditor.

Right mouse click on the line# to the left of the MScript line you wish to add breakpoint at and select Toggle Breakpoint.

You can set as many breakpoints as you need.

Next time when model is executed in debug mode , the model should paused at the initial state.

Click on again to advance the execution to the next breakpoint.

Step Next Line

You can step over current MScript line and have execution paused at the next MScript line by pressing the next MScript button .

Run To Specific MScript Line

You can advance the execution from current breakpoint and have the execution paused at a specific MScript line identified by the line number by pressing . Enter the line number of the MScript line you wish the execution to pause at.

Skip N Line

You can advance the execution by a specific number of MScript lines by pressing . Enter the number of MScript lines you wish the execution to skip over and pause with the format like this: +5.

AdHoc MScript

When the model is paused by any of the above method, you can use Monitor Tab to execute any ad-hoc MScript. To do so, enter the MScript in the Exec MScript field and click “Execute” button. It reports the result from the execution of the MScript in the field right under the MScript area.

Print/export
QR Code
QR Code mscript_debugging (generated for current page)