web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / RDP UI elements causin...
Power Automate
Answered

RDP UI elements causing flow errors

(0) ShareShare
ReportReport
Posted on by 26

I have several flows that have been working with no problems for around half a year or so, but now they don't.

Recently updated to the latest PAD version, and since then - I get this error every single time the flows run.

 

Problem while executing action 'Close'. Can't close window 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Can't close window ---> 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)

 I have tried to reinstall PAD on my computer, and "Power Automate Agent for Virtual Desktops" on the remote machine. Nothing helps.

  • krisch4 Profile Picture
    26 on at

    The error recorded in Power Automate Desktop is:

    Double click failed (error while clicking)

     

  • AK88 Profile Picture
    453 on at

    Dear @krisch4 , 

     

    The Ui of particular button you chosen might be changed, please update with new Ui and try again. 

  • krisch4 Profile Picture
    26 on at

    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?... 

  • AK88 Profile Picture
    453 on at

    Hi @krisch4 ,

     

     

    Can you please attach some screenshots for more understanding. 

     

     

    Thanks, 

  • krisch4 Profile Picture
    26 on at

    @AK88 what would you like screenshots of?

  • Verified answer
    krisch4 Profile Picture
    26 on at

    Microsoft says it will be solved in the May 2023 release, ref: Re: Power Automate Desktop RDP agent synchronizati... - Power Platform Community (microsoft.com)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard