I recently ran into a problem when using Microsoft Test Manager for UI testing. When clicking on a row in a Bound DataGridView, I would receive a warning that a step couldn’t be recorded.
Then, when I imported the test into Visual Studio when I wanted to convert it to an Automated Test, that step would report;
Last action on Row was not recorded because the control does not have any good identification property.
After a quick search, I came across a Microsoft blog which describes how to rectify this issue;
Basically, the issue is that the Test Manager resolves clicks in DataGrids and Lists by calling the .ToString() method on the item. If this function doesn’t return anything meaningful that the Test Manager can use, then the step isn’t recorded.
As I had bound my WPF DataGridView to an Observable Collection of Entities, I was simply able to override the .ToString() method in the Buddy Class for the Entity, which solved the problem quite nicely.