Ranorex provides the possibility to debug code directly in the development environment.
To enable the debugger press the 'Enable Debugging' button in the toolbar.
Breakpoints can either be set
- by clicking on the left margin at the line you want to set it, or
- by putting the cursor to the line you want to add a breakpoint, open the 'Debug' menu an choose 'Toggle Breakpoint'.
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.
Note To run an application with debugger, it's necessary to not choose 'Run without Debugger' from menu.
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:
|Continue Debugging||Continues execution|
|Stop Process||Forces the process to stop|
|Step Over||Executes the statement on the current line but it will not step into|
|Step Into||Executes the statement on the current line and stops at the first line of code inside the method|
|Step Out||Finishes executing the current method and returns to its parent method|
Debugging menu Items
Debugging toolbar items
Context menu 'Set Current Statement'
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.
Debug sub menu
|Callstack||Shows method calls currently on stack.|
|Local Variables||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.|
|Watch||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.|
Note If Visual Studio 2010 is installed on the machine running Ranorex Studio, debugging might be slow. To overcome this issue it is recommended to search the key 'LowLevelHooksTimeout' in the registry and delete all occurrences.