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 / Is it possible to chec...
Power Automate
Unanswered

Is it possible to check if browser is open and close it?

(0) ShareShare
ReportReport
Posted on by

Hello Everyone.

 

I have a browser automation flow.

 

I have set it up so that if an action in the flow fails then the flow restarts.

 

However, that means that any existing browser windows will remain open, and I want to either close them if an error occurs so that when the flow errors all browser windows or closed and a new one is opened up when the flow restarts or, if that is not possible, to somehow check to see if there are any running browser instances when the flow starts up and, if so, close them.

 

I hope this makes sense.  Any help is much appreciated.

Regards.

 

When I try this approach my flow errors and says 'BrowserInstance' must be 'Web browser instance'.

I have the same question (0)
  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    Hello,

     

    If I am reading correct, you are checking if there are any running browser instances at the start of the Flow? Well that won't work because you have to define a browserinstance first. So the error in this case is correct: you are trying to close browsers that don't exist (especially when starting out the flow). However a workaround for this is to us en on-error at the activity which jumps to the next action when the Action fails.

     

    I would highly advice using a try catch block on all subflows that can contain error. And have the flow jump to an Exceptionflow (where you close the browsers). 

     

    It's kind of hard to explain what you want or need so if you need any more help feel free to ask.

     

     

  • CU-19081228-9 Profile Picture
    on at

    Thank you for replying @OkanAT .  Your understanding is correct, and it makes sense why the error is triggered.  

     

    I have it that the flow jumps to a subflow where the browsers are closed in the event of an error.  But even when I use an 'on error' condition to go to the next action it sometimes fails and still triggers the error 'BrowserInstance' must be 'Web browser instance', but surely it should just go to the next step?

     

    Any suggestions?  Thanks so much!

  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    That doesn't make sense to me why it won't work.

     

    Another solution to the problem can be to send Keyboard Shortcuts to close browsers, back to back with intervals. For example: if you put in your flow to use the keyboard action ALT+F, 4 (max amount of browsers running) and you have 2 running at the time. Errors wont occur because after the second it would just press the keyboard shortcut and nothing would happen. This would work pretty good if you are only working with Browsers and one Browser type only.

    I gotta say I don't like this approach but if it works why not.

     

    Good luck.

  • Gidi Profile Picture
    601 on at

    Hi,

    you can kill the windows processes of the browsers with a loop and action (search for service or process). Look in the Task Manager which process the browser windows uses to find out which processes to stop. 

  • CU-19081228-9 Profile Picture
    on at

    @Gidi  I just use Microsoft Edge.  So, I guess I just kill that?

     

    My flow has one overall browser instance (Edge) and then a sub-flow creates a new browser instance off that, as a new tab.

     

    @OkanAT Thank you so much for all your advice and suggestions, I've made a few changes to my flow based off them and I'm running it to see if the issue still occurs or not.

     

    Thank you to you both!

  • HellitonWoo Profile Picture
    39 on at

    Having the same needs and found this thread to discuss it. 🙂 Thanks for all of the good ideas!

     

    I'm using another approach to tackle this issue.

    Using "On block error" to attach the window, if it wan't opened, then I'll open it, if it's already openen, then I'll move on to use the page

     

    HellitonWoo_0-1697017727608.png

     

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    You can use close web browser or close window activities and indicate the browser you need to close

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 636

#2
Valantis Profile Picture

Valantis 372

#3
11manish Profile Picture

11manish 335

Last 30 days Overall leaderboard