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 / Can't automate flow to...
Power Automate
Unanswered

Can't automate flow to accept browser alert box

(0) ShareShare
ReportReport
Posted on by 9

Hi

 

I am rather new to the Power Automate Desktop application, so there might be an obvious solution that I have overlooked. I have run into an issue trying to automate some simple navigation on an internal company web portal. When I click the "Edit" button on the page, the MS Edge browser pops up with a prompt/dialog box/whatever it is called (see screenshot below) with a message, that I wan't to accept (by clicking on the "OK" button - as marked on the screenshot below).

 

I have attempted the following: using the web recorder, using the desktop recorder, using a "click UI element..." action and using a "Move mouse to image" action. Neither of these methods worked for me when running the flow afterwards. Does anybody know if there is a solution to this, short of trying to learn some JavaScript and handle it that way?

 

2021-10-28_11-24-31.png

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi @nlmu 

    Noticed before that this pop up is not spyable via PAD.

    Give some wait time before the popup appears then try pressing sendkeys Enter.

  • nlmu Profile Picture
    9 on at

    Hi @VJR 

    Thank you for your answer, unfortunately it still doesn't work, I tried switching to "Send Text as hardware keys" as well as adding a "Select tab in window" and a variety of Wait times... but to no avail. Seems like something that MS should add to the actions list to actually solve this problem. Any other good ideas? 🙂 

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Move Mouse to Image is always a last resort.  It should continue to work as long as it doesn't change and the display ratio and screen size of the user remains the same (no remoting in).

     

    Alternatively, you could try to use "Move mouse to text on screen (OCR)".

     

    Best of luck!

  • VJR Profile Picture
    7,635 on at

    Hi @nlmu ,

     

    Its working fine after giving a Wait action and then pressing Enter.

     

     

    VJR_0-1635485609311.png

     

     

    VJR_1-1635485778499.png

     

     

    You can also manually see its behaviour at first and then mimic the same via PAD.

    After the popup shows up, the focus by default goes to the Ok button, so just need to press Enter after some Wait.

     

     

     

     

  • nlmu Profile Picture
    9 on at

    Hi all, it has been a while since my original post. The popup is still an issue for me. I see that running the test using the popup from w3schools does work, also on my PC, but when I run a similar flow on a popup from the web application I am working with, there are still inconsistencies. Sometimes the popup can be accepted using enter, sometimes it can be accepted by finding an image and clicking. The problem is, it doesn't always work and often stops working when updating the browser or PAD where I have to recreate the flow several times for it to work again. As mentioned there is no consistency in when it works vs. when it doesn't work.

     

    Is there anybody out here that has been facing similar issues and has found a solution?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    You could always do:

     

    Wait for image (fail on timeout with number of seconds-should be twice as long as you believe it naturally takes for the image to appear from your last action)

        On error continue flow run

    if image exists

        Move mouse to image with left click

        Else

            Send key {Enter}
    end (if)

  • VJR Profile Picture
    7,635 on at

    Hi @nlmu 

     

    "it doesn't always work and often stops working when updating the browser or PAD where I have to recreate the flow several times"

    Unfortunately when any updates are made to either of these, we have to redo a few things. I know that's not how it is supposed to be but it is :). 

  • nlmu Profile Picture
    9 on at

    I think this is a good alternative, but I really am not a fan of the move mouse to image function, it feels like bad coding practice to me. I will implement something similar to this and just have to wait patiently for Microsoft to hopefully release a solution.

  • nlmu Profile Picture
    9 on at

    Yes that is unfortunate, and it annoys me, but I guess I just have to deal with it and hope that better solutions will be made :).

  • Yash47 Profile Picture
    5 on at

    Thanks buddy it worked for me

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard