chaitra.kear
chaitra.kear

Reputation: 67

COM Exception HRESULT : 0XF004F003 while performing Mouse.Click(button) operation on a WinButton in Coded UI

The button is present in a ConfirmExit Window of Eclipse IDE as I am trying to automate the closing of the IDE. The window in question has 2 butttons "OK" and "Cancel".DrawHighlight() has successfully identified the button , hence the problem doesnt seem to be in the search properties.The exception is 'Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException' The code used is

   Playback.PlaybackSettings.AlwaysSearchControls = true;
   exitWindow.getButton("OK").SetFocus();
   WinButton button = exitWindow.getButton("OK");

   exitWindow.getButton("OK").Find();
   exitWindow.getButton("OK").WaitForControlEnabled();
   Mouse.Click(button);//exception occurs here

Surprisingly, the Recorded method of the UIMap Designer is able to properly identify and perform click on this button.I have used the same hierarchy used in the Designer class.The exception also talks about a blocked control being present although there isn't any.Is this an OS issue?I am using Win 8.1 and Visual Studio 2012 Premium. Does anyone have a solution for this ?

Upvotes: 1

Views: 736

Answers (1)

The problem here is some other control is blocking the control where you are trying to perform an action.Try using this before you perform the action

button.FindMatchingControls();

Upvotes: 1

Related Questions