I was following a tutorial on UiPath Academy and needed to capture a pop-up in the Edge browser.
However, I was surprised it could not be captured as an element. After searching the forum, I found at least two topics that raised similar issues but with no resolutions. See below.
When attempting to capture the element using the Click activity, I hovered the mouse cursor over it, but the pop-up or button could not be detected. I even tried the “Capture all elements” option in the Capture Elements tool, but nothing was detected in the browser window either.
Is the above a known issue? Are there any workarounds?
I suggest a workaround for this issue: you can use the Send Hotkey activity and send the “Enter” key to bypass the pop-up detection problem. This can help interact with the element indirectly.
-For Learning Purpose Only-
Additionally, if you’re looking for a more tailored solution, there is a newer activity called Close Popup, which is designed for situations like this. To use it, ensure you have the UiPath.UIAutomation.Activities package version v24.12.2-preview or later. You can update this package by going to Manage Packages, selecting Filter and enabling the Include Prereleases option, then updating UiPath.UIAutomation.Activities to the specified version. This should provide a more reliable way to handle pop-ups in such scenarios.
1. Use classic Click activity
It could not detect the OK button. The pop-up was also not selectable.
2. Use one more use application browser activity
It took a long time to complete the indicating of the application. Also, the pop-up was not selectable. After adding the modern Click activity within the Use Application/Browser activity, the result was the same: I was not able to select the button in the pop-up.
Your attachment of the browser most likely has the scope of the web page/document. The popup exists outside this scope, since this is a classic ‘alert’ sent by the browser itself, and not part of the HTML content.
Solution: use a new ‘use app/browser’, setting the browser as an app scope. Then the popup can be targeted. Most significant difference will be the selectors targeting some widget instead of the document.