Ranorex provides the possibility to debug code directly in the development environment.
To enable the debugger press the ‘Enable Debugging’ button in the toolbar.
To make the Debugger stop at a specific position in your code, you can set breakpoints.
Breakpoints can either be set
By setting a breakpoint, a red circle will be added at the margin and the line of code will be highlighted red. The breakpoint can be removed in the same way as it has been added.
After setting a breakpoint the debugger can be started by executing your application as described in the chapter Run.
The application will start and Ranorex Studio will switch to the ‘Debug Layout’ which causes the following menu items to be available from ‘Debugger’ menu and toolbar:
|Forces the process to stop
|Executes the statement on the current line but it will not step into
|Executes the statement on the current line and stops at the first line of code inside the method
|Finishes executing the current method and returns to its parent method
To skip several lines of code and continue debugging on a specific line, the context menu item ‘Set Current Statement’ can be chosen by right-clicking on the line and choosing ‘Set Current Statement’ from the context menu.
In paused mode, the actual state of the individual objects can be diagnosed.
The following windows can be activated in the sub-menu ‘Debug’ which is part of the ‘View’ menu.
|Shows method calls currently on stack.
|Shows variables defined in the function currently being executed, arguments passed into the current function and fields and properties of the class where the function is defined.
|Shows all expressions added to the watch list. Expressions can be added by right-clicking on the window, choosing ‘Add’ from context menu and entering the expression. Expressions can also be added by selecting them in code and dragging them into the ‘Watch’ window.
Additionally to the different views it’s also possible to diagnose individual objects directly in code using the tool tips popping up when moving the mouse over them.