Titlebar in Remote Desktop on Win7

Aug 24, 2010 at 3:07 PM

When I remote desktop to a windows 7 machine and run my automated tests, the TitleBar to my application cannot be found.  Have any of you guys run into this problem?

For example, this code will throw a NullReferenceException

Application app = Application.Launch(pathToApp);
Window wnd = app.GetWindow(mainWindowCaption, InitializeOption.NoCache.AndIdentifiedBy(mainWindowCaption));

Button MaximizeBtn = wnd.Get<Button>(SearchCriteria.ByAutomationId("Maximize"));
MaximizeBtn.Click();     // This line will throw the exception.



Aug 26, 2010 at 6:13 AM


can you try


/// <summary>
/// Changes the display state of the window.
/// </summary>
/// <param name="state">The display state.</param>
public static void ChangeDisplayState(DisplayState state)
   if (Ets4Window.DisplayState != state)
     Ets4Window.DisplayState = state;

Can you try to get the button using AutomationElement?

AutomationElement element = wnd.GetElement(SearchCriteria.ByAutomationId("Maximize"));
is the element also null?

can you use UISpy and have a look for the Titelbar and the button?



Aug 26, 2010 at 7:36 PM


I've checked in both UISpy and VisualUIVerify and they both don't show it.  I have also tried getting the AutomationElement for the TitleBar which returns null, as well as the button.  

I tried using that code as well and it throws an exception.


Running the same code on the machine itself without remote desktop works.  It's only when I'm trying to run code through a remote desktop on a windows 7 OS



Sep 2, 2010 at 9:20 AM

can you please let us know the exception?