cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slappydooda
Regular Visitor

Desktop Power Automate - failed to get window

Hi all,

 

I've been using PA to make (mostly excel) flows just fine. Today while editing a flow, I started getting an error. Restarted, worked one more time, and now errors every time. All UI manipulation fails. I've tried reinstall with no success.

 

Failed to press button (failed to get window)

Failed to press button (failed to get window): Robin.Core.ActionException: Failed to press button (failed to get window) ---> Robin.Shared.Runtime.ActionException: Failed to press button (failed to get window)
at Robin.Modules.UIAutomation.Actions.UIUtils.TryFuncThrowExceptionIfNull[T](Func`1 func, ActionException ae)
--- End of inner exception stack trace ---
at Robin.Modules.UIAutomation.Actions.PressWindowButton.Execute(ActionContext context)
at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

1 ACCEPTED SOLUTION

Accepted Solutions
sakula1996
Continued Contributor
Continued Contributor

Hi @slappydooda ,

 

Majority of the cases, issue will be the name attribute.

 

1. Go to the UI elements sections from the right panel.

2. Double click on the parent UI element

3. Click on edit selector/or double click on the element again

4. You should see selector builder

5. Now compare the selector builder with old Ui element selector

6. Compare the Ui element

7. If parent element looks fine and exactly same. Then compare with each child element.

8. Two things to consider here: 1. Ordinal 2.Name

 

 

Hope this helps 🙂

 

sakula1996_1-1616004840277.png

 

sakula1996_0-1616004768407.png

 

 

View solution in original post

11 REPLIES 11
slappydooda
Regular Visitor

Update: I discovered that if I recreate my UI Element references, my flows work again. That means I need to go through and redo all UI steps, though...

So at some random point yesterday, all my UI element references broke (even in the flows I wasn't currently editing). For context, I use two monitors.

 

Is there a way to log this bug? It's pretty debilitating to have all of your flows just randomly break and require rework. 

Henrik_M
Super User
Super User

Contact support 🙂

sakula1996
Continued Contributor
Continued Contributor

Hi @slappydooda ,

 

Majority of the cases, issue will be the name attribute.

 

1. Go to the UI elements sections from the right panel.

2. Double click on the parent UI element

3. Click on edit selector/or double click on the element again

4. You should see selector builder

5. Now compare the selector builder with old Ui element selector

6. Compare the Ui element

7. If parent element looks fine and exactly same. Then compare with each child element.

8. Two things to consider here: 1. Ordinal 2.Name

 

 

Hope this helps 🙂

 

sakula1996_1-1616004840277.png

 

sakula1996_0-1616004768407.png

 

 

mitsmith
New Member

Hi, I don't understand how this solution helps.  My flow is completely corrupted.  If I have to rebuild the 45 "Click UI element in window" so be it but how do I ensure that the corruption doesn't occur again?  What is causing this behavior?  Thx!

There is nothing corrupted, applications change, so does their UI. You just need to make the window selectors as robust as possible e.g. using regex and/or multiple checks on the window title/content.

https://docs.microsoft.com/en-us/power-automate/desktop-flows/ui-elements

Hi,

Thanks for the feedback!  I'm new to using Power Automate Desktop and when I started creating my first flow it concerned me about what would happen to the UI elements I grabbed if the desktop application (Crystal Reports Developer) I used changed.  With the current issue I'm facing though nothing has changed.  At this company we have to manually install/update Crystal Reports Developer (developed this flow last week - nothing has been updated).  This leads me to a couple more questions...

 

1) As I'm new perhaps I'm missing a step.  I first open Crystal Reports.  I then start Power Automate.  The first step in my flow is to click a UI element in Crystal Reports.  Do I have to have a preceding flow step that says "Activate the Crystal Reports" window (I looked for a control like that in the flow editor but didn't see it although I didn't have anything like that in place when doing the initial development of this flow)?

 

2) I looked at the link you sent.  I did use the Control/Click method to capture UI elements.  And I see the section about "Element Properties" and editing the Selector.   And I see your comment about using regex/multiple checks.  Do you know if there is a page anywhere that gives more info on manually editing selectors (I've been searching but I haven't found anything)?  

 

Thanks!

mitsmith
New Member

Thanks for the info!

HI @fraenK could you please provide a sample using regex, the window class changes the last number here is an example ClaWin073350000H_4  I can not get. to focus window to continue automation

fraenK
Memorable Member
Memorable Member

If only the last number changes, then you can use "starts with" with "ClaWin073350000H_"

did you ever manage to work out how to change the path of the UI Element , as i am experiencing a similar issue.  Each time a reference a UI element with a different window title (for the same application) i need to rebuild my flows. Not ideal . I could not work out from the documentation how to edit the selectors and parameterise the window name/title.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,225)