SearchCriteria.ByControlType(typeof(Window))

Jul 9, 2008 at 8:47 AM
Edited Jul 9, 2008 at 8:51 AM
Hello,

I'm trying to use this code below ~

SearchCriteria searchCriteria = SearchCriteria.ByControlType(typeof(Window)).AndIndex(0);

I'm getting the following error. Yes. This is a compile-time error.

Error    1    The type 'System.Windows.Automation.ControlType' is defined in an assembly that is not referenced. You must add a reference to assembly 'UIAutomationTypes, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.    C:\Michael Sync\Labs\WPFApp1\WPFApp1.Test\Window1Test.cs    61    13    WPFApp1.Test

How can I solve this problem?

I have already tried the following :

1) SearchCriteria searchCriteria = SearchCriteria.ByAutomationId("ddd").AndControlType(typeof(Window)).AndIndex(0); does't give me the compile-time error.

2) I tried to add UIAutomationClient as a reference in my test project but I'm still getting the error.

I'm using VS 2008.



Coordinator
Jul 9, 2008 at 3:40 PM
May be you need UIAutomationTypes.dll
Jul 10, 2008 at 2:44 AM


viveksingh wrote:
May be you need UIAutomationTypes.dll

Thanks a lot.
Aug 5, 2008 at 7:13 PM
i cant found the file UIAutomationTypes.dll
Aug 6, 2008 at 12:52 AM
If you are using VS 2008, that dll is in .NET Reference dialog.