“Value does not fall within the expected range” when Coded UI Test Builder generate code?

(Chinese Version)

Well this post is about a new cool feature comes with Visual Studio 2010 Team Suit: the Coded UI Test. Check out this video demo to see how VSTS2010 make your UI test so enjoyable easy.

A customer of mine was following the video demo to record a Coded UI Test and when he click “Add and Generate” button on the Coded UI Test Builder dialog, he received a error message box “Value does not fall within the expected range”. No code was generated. He tried several times with the same result.

It is a brand new VSTS 2010 RTM version installation and the tested project is newly created in it, so there is nothing about IDE or code upgrading discussed in this thread. What happened?

Problem is the application being recorded was started in debug mode.  When running in debug mode the application differs largely from non-debug mode , and the test builder is not able to handle this. To record a coded UI test, the target application must run as a standalone process. You either press Ctrl+F5 to “start without debugging”, or directly launch the process from windows resource explorer

Till next time,

-Emma