How to close Picture In Picture window after execution


I have a process running in PiP mode, but at the end of the execution the PiP window doesn’t close.

I was thinking using powershell command to use Disconnect-PSSession command without any success.

Any clue ?

The same question, just how to close it after a process finished automatically

Hi @Anton_Com

Use UiPath Click Activities to close the Window.

When closing the PiP Window, the target selector must be the [X] on the top-right corner of the PiP Window

Once the PiP window closes, a confirmation Dialog shows up. The selector for the Yes button will be as follows:

<wnd app='uipath.service.userhost.exe' omit:cls='#32770' title='UiPath Picture in Picture' />
<wnd omit:ctrlid='6' title='*Yes' />

Notice that the ctrlid and cls attributes are omitted. The title is not 'Yes' , but '*Yes'

A quick word of caution:

When debugging from Studio, the automation will fail with a “Connection lost” error . Therefore, put the close PiP activities in a Try-Catch and sink the exception (essentially, do nothing)

Hope this helps, but make sure to test it thoroughly as I see some issues because the Robot takes a long time to detect the Yes button, and once the Window is closed the Automation does not seem to end normally unless the Stop button in Assistant is clicked.

Here is how it shows up in Orchestrator logs:


If you check in UiPath assistant, you will be left with the jobs showing “still processing” status. But if you completely Quit the assistant and reopen it, these messages will go away.

I’m not sure if this is the right way. If PiP is so resource intensive, then it would be nice if UiPath could come up with someway to close PiP automatically after process completes execution.