How to use Indicate on screen to click on Message Box OK button


I want the robot to close message box by clicking on OK button. But when I am using Callout ativity or Click activity after message box , I can’t capture Indicate on screen activity, as It is done after \i click on OK button. If I save output of message box in string variable how can I use it to click OK button on message box. Please help.


Hi @Adi,

Refer this post
Issue with identifying element inside popup in chrome - #4 by arivu96


Hi @arivu96,

Not working. I just want robot to click message box’s OK button after it is displayed. PFA my simple workflow. How can I do that? Please assist.

hello orch.xaml (5.3 KB)


Hello @Adi,

I also tried running your workflow a lot but no luck.
Please have a look at screenshot that I put one more message box after indicate on screen activity.



Hi @Adi,

Could you explain what are you trying to achieve over here by doing this?

I’ll be better able to explain to you once I can understand what scenario or situation requires this particular flow. Accordingly, it’ll help us identfy what can be a possible work-around or solution to it, depending on the requirement.


I don’t think you can close the Message Box using the same bot. One work around is you could use Auto Closing Message Box, below is the custom activity if you wish to use.


1 Like

Just create another sample workflow with message box and run that workflow, message box will be displayed and use click activity in your main workflow inside parallel activity with message box and identify the OK button of your message box and modify your selector if required.


This is exactly what I was refining, this is the way it can be done.

The only thing to do to make this work is that open a second UiPath window and from there use “Click Button” Activity to get the target/selectors.

Cut/Copy Paste this “Click” Activity back into your original workflow within a “Parallel” activity, something like this:

Screenshot of “Parallel” Activity

I used an “invoke workflow activity” to run your flow, but for you @Adi, you’ll have your message box there along with the click activity.

Also, to ensure things work smoothly, I’d suggest to add a delay via the properties of the “click button” activity. Under “DelayBefore” write say “1000” since it takes it in microseconds and 1000 MS = 1 second.

Let us know what works for you (and what doesn’t. :stuck_out_tongue:).

All the Best!


1 Like

This is doable as well, for some reason slipped my mind.

1 Like

thanks @abdullahnj it worked :slight_smile: . Cheers

Hi @Adi,

You are very much welcome mate! :smiley:

Please feel free to reach out to me or the forum if you have any more queries or hiccups!

I’m sure there’s always someone to help out!

All the Best! Cheers!


Hi Abdul…can you please tell me how you resolved…if you have screenshot,can you share me…since I am not able to place message box activity in parallel activity

Hi @guptha10,

Are you still facing the problem?


hi abdul, can you explain more this, i want to close a message box automaticly after showing it like 5 seconds

Hi @ilahrech
After displaying the message box then keep the click event and try to find the selector for close the message box

For this message box


so as like your message box using the UiExplorer get the selector.


Please go through this workflow…

CloseMessageBox.xaml (8.4 KB)


This does not work.
The message box just hangs on the screen!

What do you mean by “Hangs”? Does the application freeze or the MessageBox just doesn’t close?
What is your TimeoutMS value?

What is your studio version?

Its the second one - the Message Box doesn’t close.
I tried various values of TimeoutMS - 1,2,10,20 - it just doesn’t go!

I on the UIPath Community version 18.4.1

For your timeouts Messagebox shouldn’t even be visible, it should close in blink of an eye. I will check on 18.4 when i can.

In the meanwhile, since the timeout is milliseconds can you try higher numbers for eg : 2000 which is 2 seconds.