Ability to close a popup and continue the process

Hey guys,
I’m developing a desktop automation with a very old application.
The problem is that some popup could appear in any stage of the automation and I need to close it in order to continue the process.
Is there any way to check if this popup appear on any stage of the process and close it?

Thank you in advance.


in my opinion there is only one solution. in this case we should go for Parllel activity and we have to check parllel any popup message we are getting and we have to write the logic to close the popup. thanks.