Using AutomationElement
, is there any way send clicks to a TabItem
without having to move the mouse and simulate clicks? AutomationElement
is still new to me - as far as I understand it, unless it supports the InvokePattern
(which TabItem does not) you have to go the route of locating the control location and simulating the mouse. I have that code working (see below) - I am just curious if this is my option.
AutomationElement tabControl = GetControl(window, "NOTEBOOK");
AutomationElement tabGeneral = GetControl(tabControl, "FM_STAFF_SUB_P1");
AutomationElementCollection tabs = GetAllTabs(window, tabGeneral);
System.Windows.Point p = tabs[1].GetClickablePoint();
MoveMouse((int)p.X, (int)p.Y);
ClickMouse();
Thank you.