Thanks for the reply @AK88
I have tried to recapture the UI elements, even deleting and re-adding them. Nothing helps.
For the UI element used in the "Close window" and "Wait for window content" actions, this is the selector:
:desktop > window[Name="fAutomate"][Process="explorer"]
"Close window" action error:
Problem while executing action 'Close'. Can't close window
"Wait for window content" action error:
Problem while executing action 'WindowToContainElement'. Error occured when trying to wait for window content
I also have a "Click UI element in window" action that also fails.
This is the selector for the UI element:
:desktopicons > listitem[Name="fAutomate"]
"Click UI element in window" action error:
Problem while executing action 'Click'. Double click failed (error while clicking)
All of these errors also contains the stack traces below after them:
---> Microsoft.Flow.RPA.Desktop.UIAutomation.RDP.Common.Exceptions.RdpAgentSyncRequiredException: Exception of type 'Microsoft.Flow.RPA.Desktop.UIAutomation.RDP.Common.Exceptions.RdpAgentSyncRequiredException' was thrown.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Flow.RPA.Desktop.UIAutomation.RDP.Common.TranslatingDispatchProxy`1.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.Common.Proxy.RDPAutomationRuntimeRouter.HandleAutomationAgentException(IRDPClient client)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.RDPAutomationRuntimeRouter.GetClientAndRuntime(String serverAddress, IRDPClient& client, IAutomationRuntime& runtime)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.RDPAutomationRuntimeRouter.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 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.CloseWindowBase.<Execute>b__21_0(IAutomationRuntime r, UIRuntimeElement e)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.UIAutomationActionBase.PerformAutomation(Action`2 action, UIControl control, Boolean logAction)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.CloseWindowBase.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.CloseWindowBase.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
Please note that these errors only occur for UI elements recorded from a RDP session, local UI elements work fine.
RdpAgentSyncRequiredException - Makes me think that there is a version mismatch between the Power Automate Desktop version and the Power Automate Agent for virtual desktops.
Sync/update of this should happen automatically during flow run(ref; Automate on virtual desktops - Power Automate | Microsoft Learn), but now it doesn't?
Maybe Microsoft released too many versions (2304-update3, 2304-update2, 2304-update1, 2304) and forgot to update sync functionality for Power Automate Agent for virtual desktops?...