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 / Button Press Succeeds ...
Power Automate
Unanswered

Button Press Succeeds but says Fail

(0) ShareShare
ReportReport
Posted on by 697

Hello.  So this usually works but occassionally I get this failure on this same step. I have a window that needs closed, and I need to actually hit the "close" button on it, or it locks the case.

CharlesBrewer_0-1692118413928.png

If that step fails, I have it set to retry.  The weird thing is, like it did today. It did actually close the window, but it still retries and ultimately says it fails, thus breaking the flow.

CharlesBrewer_1-1692118652367.png

It says failed, but the window was definitely closed, so Automate seems to be getting confused.

This is the error it gives : 

Problem while executing action 'PressButton'. Button-press failed. 
 
Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Button-press failed. ---> Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Common.Exceptions.WebScriptGeneralException: No tab with id: 1156795944.

 

This is the step : 

CharlesBrewer_2-1692118760507.png

This is the UI element CloseBtn : 

CharlesBrewer_3-1692118797025.png

I know that maybe looks weird for a button name but that's the best I can do for this html (I think?) : 

CharlesBrewer_4-1692118913717.png

 

Sorry that's a lot of information maybe, but I think that covers everything. If anyone has any thoughts on how I can improve this so it stops fake failing, I'd appreciate it. It doesn't fail a lot, which is weird because it does this same step hundreds of times a week, but it just occasionally decides to fail.

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @CharlesBrewer 

     

    So if the retry option wasn't enabled, so with what error it was failing ?

    This seems weird 

     

    Could u show the property of the press button action as well ?

     

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Is the button in a new tab or a pop-up? Do you attach to it properly when it opens?

  • CharlesBrewer Profile Picture
    697 on at

    @Nived_Nambiar I don't remember the error without the retry honestly, I believe it just says it's not found, even though it does in fact find it.

    And yes of course

    CharlesBrewer_0-1692193197460.png

     

  • CharlesBrewer Profile Picture
    697 on at

    @Agnius 

     

    It is in a popup yes. It opens when someone clicks on "RALink" and I attach it to browser2

    CharlesBrewer_1-1692193374636.png

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @CharlesBrewer 

     

    Instead of keeping the UI element under browser2 instance, could you keep that in Browser instance in the press button action. in other words replace the web browser instance to %Browser% and see whether it works or not 

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • CharlesBrewer Profile Picture
    697 on at

    @Nived_Nambiar 

    No I can't set it to %Browser% because that's a different window. Basically in this flow there is the main window, that is %Browser%. It will click on these RALinks, which opens %Browser2% that has the close button. From there it opens another link and opens another popup, that is %Browser3%. Which it is done, it closes %Browser3%, hopefully hits the Closebtn on %Browser2%, and then on %Browser% clicks the next RALink.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can you replace the static wait for 5 seconds with a Wait for window, a Wait for window content, or in the worst case - Wait for image action? Perhaps it's failing to attach because the pop-up is not ready?

    Also, can you share some more screenshots of the rest of the flow? Based on your reply, I guess there are more steps in the flow between attaching to this pop-up and then pressing the Close button. Maybe some of them have some unresolved dependencies when you try to press the button.

     

  • CharlesBrewer Profile Picture
    697 on at

    @Agnius The popup is ready or it would randomly die earlier. To break it down, it opens browser, then browser 2, then browser3. It does a few steps here to save things, then it closes browser3, and then it closes browser2. That is where it is sometimes failing. So if browser2 did not open, browser 3 would not open.

    CharlesBrewer_0-1692389774905.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    What does the parent element in your controls repository look like for the button element? It seems like it was captured as a local UI element, and not a web UI element. Can you try recapturing the button via the Press button on web page action? 

  • CharlesBrewer Profile Picture
    697 on at

    @Agnius 

    If this is what you mean, this all of these are under "Recording". I can delete it, or all of the ones under Recording I guess and try to recapture.

    CharlesBrewer_0-1692625196270.png

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

Last 30 days Overall leaderboard