How To Close Confirm Dialog in a Web Page

Hi,

In our work flow, we receive Confirm Dialog Using Ajax Popup Extender, See Image Below.

Manual Testing:
Click Link - Confirm Dialog - Focus on OK Button - Enter Key Working - Window Closed.

Using UI Path:
Click Link - Confirm Dialog - Focus Missing - Enter Key Not Working.

We tried using Click Event but not working, that is Confirm Dialog not closing.

image

Can you please suggest some solution to Close Confirm Dialog.

Thank You.

Best,
K.Kannan.

From the screenshot it seems that the ‘OK’ button element is being identified correctly. Its just the case that it is not being clicked when the process is run. Let me know if that’s not the case.

Try putting a Highlight activity right above the click activity that clicks on ‘OK’ button and see if the button actually highlights when it reaches that point. This way you can make sure that the selector is correct. If its not getting highlighted there itself that you may need to change the selector of the button. Please paste the selector here if possible.

If the selectors are proper then try changing the ‘WaitForReady’ property to ‘Complete’ for the Click button and See if it works.This way it will wait for the entire app to be loaded and then perform the click operation.

Also, please confirm your browser. I did tested with couple of ajax popup and it works fine. Like this: Building Modal Popup using ASP.Net Ajax ModalPopupExtender Control

Let me know if it helps.

Thanks,
Rammohan B.

1 Like

Hello,

You can also use “Set Focus or Highlight” activity. which will bring up front to UI specified element.

Cheers,
Pankaj

Hello @Rammohan B,

Thank you for your detail message and please see details below.

Added Highlight and it is picking up - See image - Tested highlight with Click and Enter Key - Still popup not closing as expected.

Below are selectors used in this - IDX 1 or 2 or 3 keep changing when I repeat again in Click Selector - Do I need to use hotkey to fire button click?

I have attached all selection option in Editor Screen.

View Source From Browser - Looks like JS Confirm Dialog called in Ajax Extender - Pasting of HTML Code is not allowed in this so adding as image.

Browser Mozilla - Set Complete in the setting.

Please take a look and feedback what I am missing.

Thank You,

Best,
K.Kannan.

Hello @Pankaj,

Thank you for your detail.

Tried using Set Focus - Issue same as mentioned above - Any other suggestion to troubleshoot this?

Best,
K.Kannan.

Hello,

try using “Click Image” after simple Click only.
have a look at below shot,

Click%20on%20OK%20Button

Cheers,
Pankaj

Hello @Pankaj,

Thanks for your quick reply - We are using Mozilla and for some reason image click not firing.

We managed to troubleshoot and fix issue by “Selecting Sendwindowmessage” in options, See below image - WIndow closing now as expected.

Issue resolved and Thank you for your help.

Best,
K.Kannan.

1 Like

Hello @Rammohan B,

After few troubleshooting steps we resolved issue using,
1 - Highlight Element.
2 - Enter Key Code, Unchecked Simulate Type and Checked Sendwindowmessages.

Simulate type not working in our website for some reason (Tested again with Simulate Type, not working).

Issue resolved and Thank you for your help.

Best,
K.Kannan.

1 Like