Hi,
My flow is working fine in attended mode, but when I try to run this in unattended mode, the Focus on window is not working properly.
So my flow includes open Excel -> Open Browser -> Focus window on browser instance -> sign in - > etc.
I'm receiving the error below, sometimes when I hit resubmit it will work, but sometimes it wasn't
any idea why this is happening?
Problem while executing action 'FocusByInstanceOrHandle'. Window wasn't found
Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Window wasn't found ---> Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Exceptions.WindowNotFoundException: Exception of type 'Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Exceptions.WindowNotFoundException' was thrown. ---> System.Exception: Failed to access the supplied window instance using window handle '0'
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.WindowContainers.GetInstanceWithSanityChecks(IntPtr windowHandle)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Window.WindowsActions.FindWindowByRetractionMode(String windowSelector, String childWindowSelector, IntPtr handle, String windowTitle, String windowClass, UIWindowRetractionModeEnum uiWindowRetractionMode, Int32 automationImpl)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Window.WindowsActions.FindWindowByRetractionMode(String windowSelector, String childWindowSelector, IntPtr handle, String windowTitle, String windowClass, UIWindowRetractionModeEnum uiWindowRetractionMode, Int32 automationImpl)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Window.WindowsActions.FocusWindow(String windowSelector, String childWindowSelector, IntPtr handle, String windowTitle, String windowClass, Int32 uiWindowRetractionMode, Int32 automationImpl)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.LocalAutomationRuntime.FocusWindow(UIRuntimeElement window, IntPtr handle, String windowTitle, String windowClass, FindWindowBy windowMode)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.UIAutomationRuntimeRouter.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
--- End of remote exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.RemoteAutomationRuntimeProxy.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.FocusWindowBase.<Execute>b__21_1(IAutomationRuntime r, UIRuntimeElement e)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.UIAutomationActionBase.PerformLocalAutomation(Action`2 action, UIControl control, Boolean logAction)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.FocusWindowBase.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.FocusWindowBase.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)