How to keep clicking image until pop up disappear?


I have a situation where I need to close a pop-up, but I don’t know how many times I need to click the button “OK” to actually close it.
Sometimes OK button needs to be clicked once in order to close the popup, and sometimes several times, I can never know exactly how many times it will show up until it is 100% closed.
It is a Citrix environment which makes this case even worse.

Any suggestions?


Use a element exists and Click inside a wile loop

I hope you have a citrix runtime


Hi @bp777

Use assign activity to assign a false value to a variable and then use while loop with condition not (variable) and place the click and element exists activity in the loop.


Hi @bp777,

Try this.


Hope this helps.

Hi @bp777
One possible solution to handle this scenario is to use the “Element Exists” activity to check if the popup is still present on the screen after each click on the “OK” button. You can place this activity in a “While” loop and keep clicking the “OK” button until the popup is no longer present.

Here is an example workflow:

  1. Use the “Element Exists” activity to check if the popup is present on the screen.
  2. If the popup is present, click the “OK” button using the “Click” activity.
  3. Use the “Element Exists” activity again to check if the popup is still present on the screen.
  4. If the popup is still present, go back to step 2 and repeat the process.
  5. If the popup is no longer present, exit the loop and continue with the rest of your automation.
    You can also add a counter variable to keep track of the number of clicks on the “OK” button and set a maximum number of clicks before exiting the loop to prevent an infinite loop.

Hope this helps!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.