Please help, I haven’t found a solution for almost a month.
Is there a faster way to click the OK button on the JavaScript alert on Google Chrome?
I’ve tried all the ways, such as click activities, click image, find image and click, inejct vbs, cv click, click image trigger, keyboard shortcuts and all the activities provided. All the same, it still takes a long time to click the OK button.
JavaScript alerts are blocking modal dialogs created by the browser.
UiPath waits for the alert to be rendered and available in the accessibility/UI tree , which often takes time or isn’t reliable.
Chrome prevents direct automation interaction with these alerts in many cases for security reasons. Soultion:
After the alert appears, send an Enter key using Send Hotkey .
How:
Add a short delay (Delay activity – around 1–2 seconds).
Use Send Hotkey → [Enter] (select browser window in the selector if needed).
This works 99% of the time because alerts are focused and pressing Enter triggers the “OK” button immediately.
I have also followed this method.
It does not run quickly and still waits for a long time up to 20 seconds to click the “ok” button on the javascript alert.
Please try the new Browser Dialog Scope activity which handles JavaScript browser dialogs: alert, confirm or prompt. It is available in the new UIAutomation package v25.10.2.
Here is a guide on how this activity can be configured: