Clicking something until it disappears

Working on an Automation which has a box called ‘more’ and I want to keep on clicking this box until it disappears.
First method I have is to create a variable called ‘counter’ and then have a Do While iteraring the ‘click command’ a specified number of times.

However I wish to make it more dynamic and so I’ve done the following:

1: Element Exists on the ‘more’ button
2: Within a Do While, I’ve added a click activity on the more button
3: Specified condition as ‘booMultiples’

Only issue is it only clicks it once!


follow this

  1. Do while
  2. Inside element exists
  3. if condition with output
  4. then side click and else side break
  5. for safety set the max loop value in do while properties
  6. Condition is true


Hope the below steps would help u resolve this

  1. Assign activity with a boolean variable

bool_exists = False

  1. Use a While loop with condition like this

NOT bool_exists = False

Inside the loop initiate again the boolean like this
with assign activity as a first activity to ensure that condition is retained for each loop

bool_exists = False

Another assign activity like this

bool_button = False

  1. Then inside the loop use a ELEMENT EXISTS activity next to the above two assign activities and indicate the element u want to keep clicking and get the output as a boolean variable named bool_button

  2. Use a if activity and mention condition as
    bool_button = True

If true it goes to then block where use a click activity to click it
If false it goes to else block where leave it empty

  1. Obviously it would be true and loop continues
    If it becomes vanish then click also won’t fail and moves to next activity of while loop

Hope this helps

Cheers @steve1977beyond

Sorry about this guys, but my original method was flawed in that I wasn’t using the correct variable for element exists.
Unfortunately I will need to still use the counter method though, as the webpage im dealing with things the ‘show more’ button is there, even when it isn’t.

Appreciate you both taking the time to reply

1 Like

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