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 / Recorded SAP gui autom...
Power Automate
Unanswered

Recorded SAP gui automation, and when it runs again, the element is not found

(0) ShareShare
ReportReport
Posted on by 36

Hi there,

 

When I recorded the operation using power automate, everything went smoothly, and the test was normal, auto-filling the text boxes. But when I log off the SAP UI and rerun the automation flow, it was told me couldn't find the UI element.

error.png

 

sap.png

 

Correlation Id: 3917d64c-fca8-4347-a4f4-05053f555484

Exception of type 'Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Exceptions.ElementNotFoundException' was thrown.: Microsoft.Flow.RPA.Desktop.Modules.SDK.Extended.Exceptions.InternalActionException: Failed to write in textbox (textbox wasn't found) ---> Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Exceptions.ElementNotFoundException: Exception of type 'Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Exceptions.ElementNotFoundException' was thrown.
 at Microsoft.Flow.RPA.Desktop.UIAutomation.Runtime.AutomationRuntimes.UIAutomationRuntimeBase.RetractElement(IntPtr windowHandle, String selector)
 at Microsoft.Flow.RPA.Desktop.UIAutomation.Runtime.AutomationRuntimes.UIAutomationRuntimeBase.PopulateTextFieldInWindow(IntPtr windowHandle, String selector, String text, PopulateTextModeEnum operationMode, MouseClickTypeEnum mouseOperationMode, Boolean simulate)
 at Microsoft.Flow.RPA.Desktop.UIAutomation.Runtime.LocalAutomationRuntime.PopulateTextFieldInWindow(UIRuntimeElement element, String textToFillIn, PopulateTextModeEnum operation, MouseClickTypeEnum mouseClick, Boolean simulate)
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at Microsoft.Flow.RPA.Desktop.UIAutomation.Runtime.Router.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)
 at generatedProxy_2.PopulateTextFieldInWindow(UIRuntimeElement , String , PopulateTextModeEnum , MouseClickTypeEnum , Boolean )
--- 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 generatedProxy_2.PopulateTextFieldInWindow(UIRuntimeElement , String , PopulateTextModeEnum , MouseClickTypeEnum , Boolean )
 at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.PopulateTextFieldInWindow.<Execute>b__21_0(IAutomationRuntimeProxy r, UIRuntimeElement e)
 at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.UIAutomationActionBase.PerformAutomation[T](Func`3 action, UIControl control, Boolean logAction)
 at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.PopulateTextFieldInWindow.Execute(ActionContext context)
 --- End of inner exception stack trace ---
 at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.PopulateTextFieldInWindow.Execute(ActionContext context)
 at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

Any suggestions?

 

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @zmsoft ,

     

    Make sure that SAP GUI Scripting is enabled on both the client and server side. This is necessary for Power Automate Desktop to interact with SAP GUI.

    If not please enable the SAP GUI Scripting option as shown in below image.

    VishnuReddy1997_0-1718341133349.png

     

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • zmsoft Profile Picture
    36 on at

    Hi @VishnuReddy1997 ,

     

    Thank you for your guidance.

    Now we have an awkward problem. None of our SAP accounts have the permission of RZ11 , so I don't know how to operate it now.

    Is my problem caused by a change in UI element Id after restarting SAP gui?

    Is this directly related to enabling server-side GUI Scripting option?

     

    Thanks & Regards

    zmsoft

     

     

     

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @zmsoft ,

     

    I will assume RZ11 is a T-code,so access the SAP ,we need the access to the T-codes.

    Yes may be you need to enable GUI scripting to run or automate SAP using power automate desktop.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • zmsoft Profile Picture
    36 on at

    Hi @VishnuReddy1997 

     

    I solved this problem by using "Start SAP transaction" under "SAP automation".

    zmsoft_0-1718351927375.png

     

    zmsoft_5-1718352566223.png

     

     

    But, I encountered the problem of tab switching again. I tried "Select SAP menu item" and "Click SAP UI element" but couldn't switch tab.

    zmsoft_3-1718352167209.png

     

    zmsoft_4-1718352435058.png

     

    Error details: 

    Correlation Id: 28a9a689-efda-4b65-a3df-2bfe79365fd0
    
    Failed to find SAP UI element.: Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Action failed. ---> System.Exception: Failed to find SAP UI element.
     at Microsoft.Flow.RPA.Desktop.Modules.SAP.Actions.SapGuiProxy.GetGuiTComponent[T](ISapSessionTarget session, String id, Boolean raise)
     at Microsoft.Flow.RPA.Desktop.Modules.SAP.Actions.ClickSapGuiElement.Execute(ActionContext context)
     --- End of inner exception stack trace ---
     at Microsoft.Flow.RPA.Desktop.Modules.SAP.Actions.ClickSapGuiElement.Execute(ActionContext context)
     at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

     

    Thanks & Regards

    zmsoft

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
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard