How to close multiple windows opened by application

Hi guys, I have zero programming knowledge :blush: I needed a loop which interacts with a PC application. This is a simple repeated task which basically involves clicking an element/button in the application. When clicked, the application opens a window which needs to be closed, and again the same element/button needs to be clicked. The time between the clicking on the element/button and the application showing the window is not fixed and it varies with what it is processing. I have been able to create and run this successfully with “click push button” and “attach window” and “close window activities.”

However, the application does sometimes open different windows, not same as the regular one, which too need to be closed and then again the same element needs to be clicked. I am not able to figure out what control flow items I need to use here.

I understand that for each window I have to specify its unique “input selector” in the properties. I got it all done, but don’t know how to put all this thing together so that the robot closes whatever window the application opens up and goes back to click on the element/button. Please help me out on this.


You can create (just hit Ctl+k) and name variable x in the application window property for each attach window.

and use it in close window activity(you just need to pass the variable x in the UseWindow property)


Please go through the UiPath Academy for more.

Happy Automation. :slight_smile: