How to deal with dialog box and press the OK button

Hi there

We have this webpage with a bunch of checkbox and then a Delete button. If you click the Delete button, the dialog box will show up saying “Delete selected posts?” with OK and Cancel button.

With combination of UIExplorer and Recording, we managed to select the checkbox and click the Delete button. However, we couldn’t do for capturing the pressing of OK button on Dialog box after pressing the Delete button.

This is the source code of the Delete button:

<input type="submit" name="del" value="Delete" class="cautionbutton" onclick="return(confirm('Delete selected posts?'));"

BTW … we are using Chrome as browser.

Any input that will be good.

Thanks

What if you drop click activity after your Delete Button click activity in your recording and have your Ok button dialogue box visible on screen. Aren’t you able to capture it? Or are you referring to dynamic selector because of which Robot is not clicking OK button?

We managed to capture the Delete button and then pops up the dialog box BUT can’t capture the dialog box for some reason.

Actually, we managed to capture for the delete button BUT thrown an error when executing it. But it launched the Dialog box ?!?!

Capture

As a last resource, try using image automation

Hi @dcpartners,

Dialog box sometime cann’t be captured by uipath.
So I think you can try to use send hotkey activity instead.

Regards,
Hoang Anh.

@beesheep Can you elaborate further on this? Not sure by image automation?

@anhth15 : It’s a dialog box of the browser. Not sure how to send hotkey activity on this ?!?!

Hi @dcpartners,

When dialog box is shown up, it normally focus on the [OK] button. So you just need to press [enter] to press [OK] button. I think it will work, at lease in my case.

Regards,
Hoang Anh.

@alanbruce
This is a community forum not an advertising platform :slight_smile: . This plateform is all about to share and enhance the knowledge related with Uipath Tool.

And on two post you are posting such Topic irrelevant link.

please read and follow the community Guidelines Strictly.

Regards…!!
Aksh

1 Like

Tried your suggestion. When the dialog box came up (did focus to OK button), then pressed Enter but it won’t recorded the activity ?!?! Any ideas?

Finally managed to capture this OK button dialog box.

1 Like

How did you do it…?