Skip to content

Debugging scenarios

Michael W Powell edited this page Dec 8, 2020 · 2 revisions

There is nothing special about an xWellBehaved.net scenario with respect to debugging. You can use all your usual debugging tools, such as break points, stepping, etc.

However, it is important to recall that the test author defines step entry points, the entry points of which are of interest to you while debugging. The actual specifications themselves are of little to no interest, outside of defining meaningful, easy to recognize steps.

The incorrect way to debug

A common mistake is to put a break point on an entire step statement like so:

Incorrectly placed breakpoint

When you hit this break point, the values of x and y will be 0 because none of the steps have been executed yet, including the step you are attempting to debug:

Debugging an incorrectly placed breakpoint

The correct way to debug

Put your break point on a statement in the body of a step like so:

Correctly placed breakpoint

When you hit this break point, the values of x and y will be 1 and 2 because the previous steps have been executed, and the step you are attempting to debug is being executed:

Debugging a correctly placed breakpoint

Source stepping

From xBehave.net version 2.2+, including the beginning of xWellBehaved.net, both support source stepping via SourceLink. To set this up in Visual Studio, follow the Example.

Clone this wiki locally