How to gracefully close Chrome windows from old execution instances?


I have a bot that emulates a process in Chrome. Sometimes the bot fails because of the presence of Chrome windows from previously failed executions where the same was not closed.
Killing the process result in the appearance of a pop-up window in Chrome saying something like ‘Do you want to restore the previous sessions?’ which is difficult to handle.
How this can be sorted where the bot would check if there is a Chrome browser window already opened and then gracefully close it before starting the actual execution?

Hi @humanity2003

Welcome to UiPath community

Have you tried with Close application activity

Check out the docs

Hope it will helps


Hi @humanity2003 ,
1)Before starting your process execution just add the kill process/close application activity and give chrome name there, hence it will close chrome before your execution starts if chrome was open.
2)Now coming to the pop up just after kill process add element exists activity and indicate that pop up.
3)Then inside an if condition if pop up exists click on “no”, if pop up does not exist go with normal flow of execution.

Thanks & Regards,
Shubham Dutta

1 Like

Hello @humanity2003 , Try this steps
1.Use kill process activity, and enter the “Chrome” as process name.
2. then place the open browser
2.1 In it, place the maximize window
2.2 use click activity to close the pop and set properties as continue with error.
if the pop comes it will click close otherwise proces will continue

You can try using close window activity after using attach browser.