locked
What kinds of the situtations in which the Exception "FailedToPerformActionOnBlockedControlException" will be thrown out, I encounter it. RRS feed

  • Question

  • My question is when the exception "FailedToPerformActionOnBlockedControlException" will be thrown out.

    My codes is just clicking on a link in web page,  and then clicking the another link on the next page.

    then I got the exception "

    "Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlException: Another control is blocking the control. Please make the blocked control visible and retry the action.

     

    "

    My link is visible.

    so,any ideas?

    Thanks in advance

    Grrison


    Grrison
    Monday, March 29, 2010 7:25 AM

Answers

  • It seems in my case, the control is not hidden or blocked by other controls.

    I add coordinations to the Mouse.click(control, new point());

    then the control is clicked.

    I think if the control is blocked or hidden by other control, it will not works even when I add coordinations to Mouse.click method.

    Thanks.


    Grrison
    • Marked as answer by Grrison Wednesday, March 31, 2010 5:29 AM
    • Marked as answer by Grrison Wednesday, March 31, 2010 5:29 AM
    Wednesday, March 31, 2010 5:29 AM

All replies

  • This will be thrown whenever the control is blocked by other conrol and Coded UI Test engine is not able to make it visible. For example if your hyperlink is completly overllaped other control on the same page, then it is impossible to click on the hyperlink.

    Another case is, if some other window is hiding it. And the other window has "Always On Top" property set (for example task manager window)

    Monday, March 29, 2010 9:37 AM
  • It seems in my case, the control is not hidden or blocked by other controls.

    I add coordinations to the Mouse.click(control, new point());

    then the control is clicked.

    I think if the control is blocked or hidden by other control, it will not works even when I add coordinations to Mouse.click method.

    Thanks.


    Grrison
    • Marked as answer by Grrison Wednesday, March 31, 2010 5:29 AM
    • Marked as answer by Grrison Wednesday, March 31, 2010 5:29 AM
    Wednesday, March 31, 2010 5:29 AM
  • this is very intresting. does it work only for (0,0). Can you try 'Mouse.click(control, new point(2,2));' ?
    Tuesday, April 6, 2010 5:47 AM
  • Yes, it works for (0,0). 

    :) interesting~


    Grrison
    Tuesday, April 6, 2010 1:10 PM
  • sorry i didn't get that. it works only for (0,0) or it also works for (2,2)?
    Tuesday, April 6, 2010 6:30 PM
  • ok here is how a point to click (for MSAA atleast) is obtained:

    1.  try click on mid point (left + width/2, Top + height/2).
    2. try click on any of following (*).

                a------b----c

                d               e

                 f-----g-----h

       you might thing that these are on border so (0,0) should be tested but normaly clicking on border doesn't have any effect as controls like button might have defined a border for visual appeal. so normaly you leave 1 or 2 pixels for border hence instead of (0,0) you try to click on (1,1).

       3. Finally try to click on points at regular interval on diagonals of the bounding rectangle.

    if none of the above points are clickable then you may get this failure. justification for this is that if you have a control that is obsecured on all above mentioned points then you might want to check your UI. its not a very user friendly control.

    In your case the control might be hidden by another control (like a child label) leaving only border 1 pixel perimeter to click. check the heirarchy and bounding rectangles please using the locator.

    Wednesday, April 7, 2010 11:16 AM