A “Duh!” Moment with Coded UI Tests and the GridView

So you created your coded UI tests generating more and more data as you progressed. And then you run your very first tests incorporating a GridView–and they fail!

Of course they fail as the GridView item that was clicked when recording the test has now been pushed down to a different row. Usually UI changes are no problem because coded UI tests locate an UI object by it’s ID–but the ID has changed, too. That’s because the GridView has to generate it’s objects IDs based on their placement in it’s columns and rows. So the UI object’s ID may have changed from ctl00_m_g_b19d521f_a605_448d_958f_104697223a0c_mySPGridView_ctl03_ctl01 to ctl00_m_g_b19d521f_a605_448d_958f_104697223a0c_mySPGridView_ctl03_ctl03.

That’s not a complaint but just a reminder. And of course this will apply to other controls implementing the INamingContainer interface like Repeater or ListView, too.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

One Response to A “Duh!” Moment with Coded UI Tests and the GridView

  1. ElCorbo says:

    Perfect example of what I am dealing with…have you discovered any great solutions? Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s