How to debug a Coded Step in Test Studio?

Learn more about Test Studio here

Recently in one of the customer interaction I came across a question that how a Coded Step in Test Studio can be debugged? This is an important query and can be very useful while writing complex Coded Step.

So let us begin with following recorded step,

image

As we see step 6 is a Coded Step. We need to debug this step. To being with we cannot debug a particular line of coded step in Test Studio desktop version. In Test Studio desktop version we can put breakpoint to debug only at Test Step level. So we can put a breakpoint on Test Step as given below. Test Studio will wait for user at step 3, 4 and 6.

image

Putting breakpoint at Test Step level is simple. However our requirement is to debug particular line of code in Coded Step. We cannot do this in Test Studio Desktop version. But this can be done in Test Studio plug-in of Visual Studio. So we need to follow below steps to debug coded step.

Very first open Test in Visual Studio and put a breakpoint in line of the code we need to debug. This can be done as follows,

image

After this open Test Explorer. To open it from menu select Test and then Windows and then Test Explorer. See the image below for reference.

image

Once Test Explorer is open select test (of which coded step you want to debug). In this case that is Test3 and right click on that and from context menu select Debug Selected Tests as given in below image,

image

Now on debugging of that particular test you will find breakpoint is being hit.

image

We learnt it is super easy to debug a codes step in Test Studio. I hope you find this post useful. Thanks for reading.

Learn more about Test Studio here

Advertisement