In do while loop how to find mutlipe UI elements?

Hi,
Please help me it’s my first professional project. I need to repeat multiple clicks on UI elements and made a do while loop. but Sometimes that UI elements (pop-up) appears or sometimes not. therefore need to repeat different sometimes enter or click. Can someone please guide me what is the best option for loop actions on different UI elements? I know my question is confusing but don’t know how to ask? please guide me

@adim

You can use the Find Element to look for the Pop Up.
But since many ways to show Pop Up, you need to adjust to make it work.

Please find attached workflow for detecting a popup.
FindElementPopUp.zip (2.4 KB)

Hi thanks for File,
Problem is i am importing Excel file into SAP then Pop up appears agian and again and have click. but sometimes if Pop up is not appearing then have to press enter. I am using do while for click and do while for Enter. how to make a decision between Pop up and Enter to teach the bot. Can you please guide me If its not clear then please write me back i can explain in more Detail.