public override void Run() { DesktopWindow window = desktop.GetWindowByHandle(handle); if (window != null) { window.Focus(); response.Elements = GetAtsElementsArray(window.GetElements(tag, attributes, null, desktop)); } else { response.Elements = new AtsElement[0]; } }
public override void Run() { DesktopWindow window = desktop.GetWindowByHandle(handle); if (window != null) { window.Focus(); Task <AtsElement[]> task = Task.Run(() => { return(window.GetElementsTree(desktop)); }); task.Wait(TimeSpan.FromSeconds(40)); response.Elements = task.Result; } else { response.Elements = new AtsElement[0]; } }