This project is read-only.

Getting Window Names

May 20, 2010 at 3:48 AM

Does anyone know how to get the properties for SolutionExplorer window of Visual Studio 2010 using White? If I pass the name "Solution Explorer", it doesnt work.

Is there another way to do this?




May 20, 2010 at 8:12 PM
Edited May 20, 2010 at 8:16 PM


have you tried UISpy or UIAVerify to be sure that "Solution Explorer" is the correct name of the window?

In most cases I use


application.GetWindows().Where(p=>p.Name == "name").First();





works only for the main window in every case. 

In some cases I use


List<Window> windows = application.GetWindows();

and a "for" or "foreeach" loop, to be sure I found the correct window.

if I don't found the window I wait a short time and try again

Or in other cases I use 

application.GetWindows().Where(p=>p.AutomationElement.Current.AutomationId == "id").First();