Given an Automation Element how do i simulate a single left click on it

automation, c#

Solution

try with:

AutomationElement child = walker.GetFirstChild(el);
System.Windows.Point p = child.GetClickablePoint();
Mouse.Move((int)p.X, (int)p.Y);
Mouse.Click(MouseButton.Left);

Links: AutomationElement.GetClickablePoint Method Simulate mouse Enter/Move/Leave on WPF control without real mouse usage

Edit for comment

See this links:

Mouse.cs NativeMethods.cs Introduction to TestApi – Part 1: Input Injection APIs

Problem

``` AutomationElement child = walker.GetFirstChild(el); ``` using windows automation How do i simulator a left single click on Child ?

Original source