Close Popup activity

Hello,

In my UI workflow I need to steer a browser popup. (see screenshot) I tried to use “Close popup” activity for this but it doesn´t work.

Is there any other option how I can close this popup?

FYI - I am working in a cross-platform project.

Thanks a lot in advance!

Sabine

You can just click Ok with a normal selector in my experience. You can’t do that?

Hi @sabine.klemenjak

Please use send hotkey activity and pass the ok there

If solutions work for you please mark as solution

Thanks

@sabine.klemenjak

Can show how you set up the close pop up activity. make sure your Ok/Cancel buttons should be available in that activity.

If still this doesn’t work, then follow below steps,

  • use check app state to find the whether pop is available or not - this will ensure whether pop is available or not. if you directly use click activity or anything that may throw error in future when pop is unavaialble.
  • then use click activity and indicate that pop up button based on requirement.

If you find this helpful please mark it as solution.
Happy Automation!

Hey,
I set it up like this.

The check app state approach doesn´t work for me as it is unable to fine the button. I am not sure if this is a site effect of using a cross platform project.

I had that in the previous windows project type. But we needed to switch to use cross platform projects in Studio and now this approach is not working anymore.
I assume because of the project type.

Do you mean the keyboards shortcuts activity?

How you used check app state activity, make sure you are indicating the entire popup text instead of buttons.

If still that doesn’t work even you did setup perfectly, then try use cv activities.

Hi @sabine.klemenjak

Have you tried by using element exists activity and also
Check the below thread for your reference

Hope it helps!!

Yes you can use that or you can try to click ok by using simple selector

@sabine.klemenjak

Try using Close Popup actyivity

Hey,
I tried to but it seems like I am doing something wrong as it is not working. It seems like it is unbale to recognize the popup and always gives make “handled” = false.
set it up like this:

still doesn´t work.
What are cv activities?

CV activities are the image based automations, you can search in activities panel by search CV Scope, under CV you can find all the cv related activites.

Follow below steps,

  • Take CV screen scope
  • Use CV element exists to check pop is avaialable or not.
  • use CV click activity to click on either cancel/ok

those can´t be used in cross platform projects

Cross platform indeed makes some interesting limitations.

Can you check if the Inject JS activity is available in cross platform?
If so, before you press the button that causes this popup, go to the chrome dev tools, and in the console enter this

window.confirm = function() { return true; } // auto OK

You can also try it with window.alert or window.prompt as its not clear which one this is, Seems like confirm though.

If doing that in the console handles the ok popup and you have the Inject JS activity in cross platform you can inject the javascript to suppress this dialog before you press the button, and restore the functionality incase anything else requires it afterwards.

I’ve been messing around alot with Inject JS recently, its interesting whats possible now with coding agents and this.

Hi @sabine.klemenjak,

From the forum discussion, this popup looks like a browser-native dialog. In Cross-platform projects, Close Popup may not always handle these consistently.

You can try:

  • Send Hotkey → Enter
  • Keyboard Shortcuts
  • Or use Check App State/Element Exists before clicking OK

Also enable AI-Enhanced mode in Close Popup if available.

References: UiPath Close Popup Activity

Then give a try with Inject JS, take a look for below

Take inject js activity,
and some js code from google. for reference,

Inject java script activity is available. I am investigating if I can steer the popup with it. (would need to once click OK and once click cancel)

Interesting, I think the ok is true and the cancel would be false.