Skip to main content

Notifications

Community site session details

Community site session details

Session Id : NZ1LsG/5P4y+GahKkYQcBq
Power Automate - Power Automate Desktop
Answered

Close web browser - on error functionality

Like (0) ShareShare
ReportReport
Posted on 7 Feb 2022 07:54:07 by 44

Hi,

 

I am having some problems with the on error functionality of the close web browser action.

In the code, I have set the on error of close web browser to "continue flow run -> go to next action". For some reason this will not happen, if the web browser instance is not in correct format. then the step fails, regardless of the actions set in "on error".

 

Am I using the on error incorrectly or is this an error in the software ?

 

Below code will result in the On error functionality not working

image.png

 

  • Verified answer
    MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 07 Feb 2022 at 08:39:09
    Re: Close web browser - on error functionality

    I believe the error focuses on “I tried to close it, but I wasn’t able to.”  In this case, there is just nothing to close, and I don’t think they built that error into the system. 

  • Daniel23 Profile Picture
    44 on 07 Feb 2022 at 08:18:57
    Re: Close web browser - on error functionality

    Hi @MichaelAnnis,

    Yes, I didn't include the real scenario as it would be a longer post. But briefly, all our flows are built with a "shutdown" procedure if the flow fails. This shutdown procedure closes all applications that was opened by the flow so that the next flow will not be affected.
    In this shutdown procedure we use Close web browser (if the flow has used a web browser) and this is where I am facing the issue.
    I believe you are right that an if-statement could be used, but I just dont understand why the built in "on error" functionality of close web browser cannot continue if the browser variable is empty...

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 07 Feb 2022 at 08:14:13
    Re: Close web browser - on error functionality

    Shot in the dark, because I don’t really know what the scenario is. I know you set this up as a test, but there is nothing to do after, so what you showed me, I wouldn’t be surprised if it didn’t error out, because you told it on error to just keep going, then the flow would have ended and your browser is still open.

     

    Believing that you are simply showing this as an example, let’s build a workaround.

     

    If %Broswer.IsAlive% = ‘True’

        Close web browser %Browser%
    End (If)

     

    To be honest, I don’t know if the syntax  for %Browser.IsAlive% is ‘True’ , ‘true’ or ‘1’ , so I would suggest setting a random variable to %Browser.IsAlive% when you know it to be true, and see what it comes back as.  Should be a text value. Then make the IF statement match that text value.

     

    Good Luck!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 11 Super User 2025 Season 1

#2
KO-05050229-0 Profile Picture

KO-05050229-0 4

#2
Brad Darragh Profile Picture

Brad Darragh 4

Overall leaderboard
Loading started