Can't get control that is in raw view (uiSpy)

Apr 27, 2009 at 9:35 PM

I'm having trouble getting my white tests to get a control that is only visible in raw view of UI Spy.  I've done some searching and there is an older thread ( which is my exact issue, and the corresponding ticket ( which was closed and fixed in release 0.17.  I am using 0.17 but it still doesn't seem to work for me.  Should I be able to get the control the same way I would any other?

var searchCriteria = SearchCriteria.ByText("Remove a Revision");
var label = window.Get<label>(searchCriteria);

I've even tried to get every control of type "System.Windows.Automation.ControlType.Text" found on my page, but it still doesn't find the one that I'm looking for.

Am I missing something?

Apr 29, 2009 at 3:32 PM
To get around this, I'm trying to use the RawViewWalker that has been mentioned.  I've never used this before and I'm doing a lot of research online to try and figure it out, but I'm not finding it very easy.

Can anybody give me an example of using the RawViewWalker to get some controls from the UI?
May 25, 2009 at 7:20 AM

Can you try out 0.18. Checkout UIItems section in the documentation

Jun 10, 2009 at 11:47 PM

Hi Vivek,

I'm now using version 0.18, but I still can't get any elements that only show up in Raw view in UISpy.


Jun 15, 2009 at 5:18 PM

have you checked section on WPFUIItems here

Jun 16, 2009 at 3:14 PM

Yes I took a look at the WPFUIItems in that documentation, but still no luck.  My app isn't a WPF app, it's a SilverLight app.  Might that be the problem?

Jun 19, 2009 at 9:36 PM


I was able to get control of a text control type that was only shown in Raw view of UI Spy.  I had to use the "GetElement" method.

           var searchCriteria = SearchCriteria.ByText("Text to search for");
            var textNeeded = AppEnvironment.window.GetElement(searchCriteria);
Jun 25, 2009 at 4:15 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.