Unit Tests in Visual Studio 2010
- by Ben
Hi, i am trying to create a Unit test for a WinForm in a Visual Studio 2010 project.
I add a new "Coded UI Test" to my project, open up the code file, then right click and select "Generate Code for Coded UI Test" - "Use Coded UI Test builder". I then start my application up, select "Record" on the UI Map control. I run my tests (in this case simply select a textbox, type in a random value, them click a button). I then select "Generate Code" from the UI Map control which generates the code which the test will use.
When running this test, i get the error:
Test method
HelloWorldTest.CodedUITest1.CodedUITestMethod1
threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException:
The playback failed to find the
control with the given search
properties. Additional Details:
TechnologyName: 'MSAA' ControlType:
'Window' Name: 'Form1' ClassName:
'WindowsForms10.Window' ---
System.Runtime.InteropServices.COMException:
Error HRESULT E_FAIL has been returned
from a call to a COM component.
Does anyone know where i am going wrong?
Thanks