Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlException: Another control is blocking the control. Please make the blocked control visible and retry the action
-
Tuesday, October 25, 2011 5:16 PM
Hi All,
I have a text box in my application and trying to type some texxt on it through CodedUi test script.
I am getting the below blocking exception while doing so and script is failed. This exception is intermittent. sometimes it passed and sometimes it is not. so results are always inconsistent.
Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlException: Another control is blocking the control. Please make the blocked control visible and retry the action
Additional Details:
TechnologyName: 'UIA'
ControlType: 'Edit'
AutomationId: 'InputTextBox'
---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F003Can you please help me what could be the root cause of this issue ?
Any help/hint in this regard would be highly appreciated
thanks in adavnce!
Reagrds,
Bhanu
Bhanu Prakash pemmasani
All Replies
-
Friday, October 28, 2011 12:38 PM
I just posted a similar response. Can you cut-paste the recorded script for this action (and the control's UIMap)? Also, when it fails with the above exception, do you see any visible control blocking it. Try the following :
try
{
Perform your action on the Edit control;
}
catch (FailedToPerformActionOnBlockedControlException)
{
Fetch the bounding rectangle of the Editcontrol;
UITestControl controlBlocking = UITestControlFactory.FromPoint(rect.X + rect.Width/2, rect.Y + rect.Height/2);
}
What does 'controlBlocking' return ?
Thanks,
~ Tapas
-
Saturday, October 29, 2011 1:29 AM
I have same issue. I am trying to click on a Silverlight image which opens up a Popup window. I tried above code you suggested and i see controlBlocking object is
[Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfEdit] = {Name [Text Editor], ControlType [Edit], AutomationId [WpfTextView], RuntimeId [7,7088,35645798]}
which is strange. Can you please throw some light here?
-
Monday, October 31, 2011 3:18 AM
Just to be completely sure, you are saying, when you clicked on the control, Coded UI Test recorded a click on an Image control. During playback, at the same control position, Coded UI Test now reports that the control at that point is a Edit control. Am I correct ?
How does this Edit control and Image control interplay in the UI? I mean, what's there relation in the actual UI hierarchy. Also, what does UIspy/Inspect tool identify the control at that point as ?
Thanks,
~ Tapas
-
Tuesday, November 01, 2011 5:36 AM
This issue was resolved offline. The image control is actually below another control in the Z-index; hence it cannot be clickable. The only way out is to get its bounding rectangle and do an absolute screen coordinates click.
~ Tapas
- Proposed As Answer by Tapas [MSFT]Microsoft Employee Tuesday, November 01, 2011 5:36 AM
- Marked As Answer by Shubhra Maji MSFTMicrosoft Employee, Moderator Friday, November 04, 2011 10:54 AM
-
Wednesday, November 30, 2011 8:53 PM
hi Tapas,
i am getting following error while playing the script..
i did not get where you want me to run above code to get the visible control
Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlException: Another control is blocking the control. Please make the blocked control visible and retry the action
Additional Details:
TechnologyName: 'MSAA'
Name: 'account'
ControlType: 'Edit'
---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F003

