Getting Window Names

May 20, 2010 at 2: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?

Thanks,

Meenakshi

 

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

Hi

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();

 

because

application.GetWindow("name");

 

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();

Throndorin