Debug test with specific DataRow
I think there's no way to debug a parameterized test with a user-selected set of data. I have to let it loop through all the DataRows, hitting my breakpoint repeatedly, until I get to the parameter values that I want.
Suggest adding a right-click menu to the bottom pane of Test Explorer with a "Debug this test case" entry. It debugs the test with just that case's DataRow:

That's true, the workflow of debugging a data driven test needs improvement. We could either go via the approach you suggested above or start showing each row in a data driven test as a separate Test in the test list itself. So the test explorer would start to read: Failed Tests (2)
OutputFile_DefaultValue("FailingVal1")
OutputFile_DefaultValue("FailingVal2")
Passed Tests (2)
OutputFile_DefaultValue("PassingVal1")
OutputFile_DefaultValue("PassingVal2")
Skipped Tests (1)
OutputFile_DefaultValue("SkippedVal1")
Since these are distinct test cases of their own one can run/debug a subset instead of all of them. This does not however provide an overview for the base test method but I'm not really sure how important that is, given that each of the data rows are running separate test cases anyway. /cc: @pvlakshm
Please don't do that 😨 NUnit takes that approach, and it makes the list painful to browse because there are way too many entries. MSTest's current approach makes the list much more browsable. That extra level of hierarchy is so nice.
Got it. I cannot seem to figure out an existing paradigm where we can fit this in though. The test details pane where the tests show up is more of a non-actionable container with metadata. I'm wondering if we can leverage the drop-down where test status shows in your diagram(Passed/Failed/Skipped) to get it showing for data driven tests as well.
Tagging @sbaid @pvlakshm @codito @navin22 @rahulpaw.
That would solve the root problem (need for a level of hierarchy for multiple results). I feel like MSTest is changing to support Test Explorer, though. It should probably be the other way around. Who owns the Test Explorer code?
I've tagged everyone on this thread. We need to figure out an experience for this. Here are the suggestions we have at present:
- Running it from the Test details pane(which was what @JVimes initially suggested above)
- Running it from the Test Explorer item list window itself under a drop down that holds the summary result and each individual item shows up under that drop down when expanded. This just pulls the data from the test details pane to the currently actionable pane where Run/Debug works.
Added this issue in Visual studio developer community. Hence closing this issue. https://developercommunity.visualstudio.com/content/problem/158617/debug-test-with-specific-datarow.html
We are separating out IDE related issues from the core test framework related issues. We a tracking core test framework related issues in this repo, and are requesting that issues related to Test Explorer, sln/proj file support, and other IDE related issues be filed via VSFeedback (as mentioned in the issue template). Accordingly, closing the issue here.
i got around this by just commenting out the DataRow attributes that i wasn't debugging @ the moment
I don't like changing the order of DataRow or commenting out others because it requires compilation of the DLL. When the test library is large, compilation takes time.
maybe its better to make some functionality to VS that will allow to right mouse button on specific data row and select "debug with data row" and it will debug with that data row you clicked?