You can use Visual Studio 2012 to create automated tests of the user interface (UI) known as coded UI tests. These tests provide functional testing of the user interface and validation of user interface controls. Automated UI tests enable you to test that the user interface is functioning correctly after code changes. They are quicker to run than manual tests. Therefore, you can run them more frequently.
Visual Studio 2010 partially supported Coded UI Testing for SharePoint while Visual Studio 2012 was pretty close to fully supporting this but there were a few SharePoint specific issues that the product team wasn’t able to address that made CodedUI (functional testing) not work well for SharePoint. In Visual Studio 2012 Update 1, those issues were addressed and now Coded UI Testing is fully supported for SharePoint 2010.
I’ve recorded a quick video (in Arabic) to help you quickly get started with Coded UI Testing for SharePoint, you can watch the video here
Please note that you might need to change the quality to 720 px (HD) as shown below for the best experience :