Cogitek RIATest 6 Documentation Copyright © Cogitek Inc.

Debugging tests

If you encounter unexpected errors during running of your tests you can debug your scripts. To start debugging session select Run -> Run Tests menu. Project scripts will start running as usual however if any problems are encountered during running (such as checkpoint or action failure) the script will be suspended and the troubling line will be highlighted. Errors that cause break are the following:

Last message in message log will usually explain the problem (e.g. Expected vs Actual values will be shown for a failed checkpoint). You can switch to your application and inspect components and their properties. You can also examine your script and values of variables (if any are used) by placing mouse pointer over variable names.

When execution of the script is suspended due to an error you can still continue execution from the next command (except for failed assertion, which terminates the execution of current script).

When debugging you can execute test scripts step by step using Run -> Step command.


If you need to execute scripts up to a specific line after which you would like to examine variable values or continue execution step by step you can use breakpoints. To set a breakpoint set cursor on a line where you want to break and select Run -> Toggle Breakpoint command. This will set a breakpoint. Then Run the tests. When execution reaches the line where you set the breakpoint execution will be automatically suspended. You can have as many breakpoints as you like in one or more script files.

You can see the list of currently set breakpoints using View -> Breakpoints command. From the Breakpoints view you can disable a breakpoint. Disabled breakpoint remain in the list but they do not suspend the execution of tests.

Edit and Continue

Edit and continue is a feature that lets you modify your scripts without stopping the debugging session.

To be able to use Edit and Continue feature you need to disable "Mark editors readonly when running" options from View -> Options menu. Once this option is unchecked you will be able to edit the scripts while execution is suspended on breakpoint or when stepping. In most cases you will want to modify script text that is after the current suspended line so that further execution is performed using modified script text. However you can also modify script text before the suspended line which can be usefully if you have loops or function calls in your script which can change the execution order from usual up-down line by line sequence.

It is important to understand that some changes are not possible to do in Edit and Continue mode. For example if the execution is suspended on a line that is contained in a 'for' loop you may not delete the 'for' operator as it will totally change the meaning on the script program (although you can change condition or increment expressions of 'for' loop). If you attempt to perform non-compatible changes in Edit and Continue mode you will be warned and will have a choice to discard changes and continue debugging or stop debugging and apply the changes.

Runtime Errors and Debugging

When running from RIATest IDE in debug mode and when "Break on errors" Preferences option is enabled RIATest will suspend execution on errors so that you have a chance to examine what is going on.

If the error generated is non-fatal you can continue execution of the script from that point. If you do not want the errors to suspend the execution of the script you can disable the "Break on errors" option from View|Preferences menu or you can do Run Without Debugging instead of Run.

Note that when running from the command line the execution is always done in non-debugging mode (similar to Run Without Debugging menu command of IDE) so the execution is never suspended.

Found a typo? Have a suggestion? Please submit your request here.