title: CODEDUI c# Cannot clickSharePoint Ribbon Control
body: <p>As part of an automated test, I cannot click on the SharePoint Ribbon to select the "Alert Me" control. I am getting the following error:</p>
  
  <p><strong>Result Message:</strong> 
  Test method CodedUITestProject2.CodedUITest1.SetAlert threw exception: 
  Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Cannot perform 'Click' on the hidden control. Additional Details: 
  TechnologyName:  'Web'
  ControlType:  'Hyperlink'
  TagName:  'A'
  Id:  'Ribbon.Library.Share.AlertMe.Menu.Scope.AlertLibrary-Menu16'
  Name:  ''
  Target:  ''
  InnerText:  'Set alert on this library'
   ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F002</p>
  
  <p>Please find my code below: 1. and 2. work and it errors out at 3. I've tried adding and subtracting different control settings.</p>
  
  <p>//1. Select the Library Tab on the ribbon</p>
  
  <pre><code>        UITestControl CLR = new UITestControl(browser);
          CLR.TechnologyName = "Web";
          CLR.SearchProperties.Add("InnerText", "LibraryLibrary Tools group. Tab 2 of 2.");
          CLR.WaitForControlReady();
          Mouse.Click(new Point(CLR.BoundingRectangle.X +   CLR.BoundingRectangle.Width / 2, CLR.BoundingRectangle.Y + CLR.BoundingRectangle.Height / 2));
          CLR.WaitForControlReady();
          //Mouse.Click(CLR);
          Playback.Wait(3000);
  
          //2. set focus on the a pane control on the ribbon    
  
          UITestControl FRL = new UITestControl(browser);
          FRL.TechnologyName = "Web";
          FRL.SearchProperties.Add("TagName", "SPAN");
          FRL.SearchProperties.Add("ControlType", "Pane");
          FRL.SearchProperties.Add("Class", "ms-cui-groupTitle");
          FRL.SearchProperties.Add("InnerText", "Share &amp; Track");
          FRL.WaitForControlExist();
          FRL.SetFocus();
          Mouse.Click(new Point(FRL.BoundingRectangle.X + FRL.BoundingRectangle.Width / 2, FRL.BoundingRectangle.Y + FRL.BoundingRectangle.Height / 2));
          Playback.Wait(3000);
  
  
          //3. Click on "Alert Me" ID 
          UITestControl AM = new UITestControl(browser);
          AM.TechnologyName = "Web";            
          //AM.SearchProperties.Add("Inner Text", "Alert Me");
          AM.SearchProperties.Add("Id", "Ribbon.Library.Share.AlertMe-Large");
          AM.WaitForControlReady();
          Mouse.Click(new Point(AM.BoundingRectangle.X + AM.BoundingRectangle.Width / 2, AM.BoundingRectangle.Y + AM.BoundingRectangle.Height / 2));
          Playback.Wait(2000);
  </code></pre>