Element Exist Looping

Hey Friends,

i have a case in which i have to keep clicking on the green tick multiple times till it disappears by its own (number of clicks vary from time to time)

the problem is that i used below while loop, but iam stuck in infinte loop, since it keeps looking for the same screen.

any suggestions

When you use Element Exists, it return Boolean value (True or False). Please take If Condition
If ManualValuation = True
Give a try… it will work for sure…

Hello Friend,

I tried, it didnt work, because i have to click more than one time on the pop up till it disappears, so iam not able to break the while loop, it gives error.

@m0e91
use ‘Do While’ Loop.
Keep your Click Activity and Element Exists both Inside the Do Block.
In the Condition of Do while Activity, provide the Boolean output from Element Exists Activity.

You can also use ‘On Element Appear’
Indicate the Green Tick in this activity.
Inside Do block, provide the click activity.

Make sure the ‘Repeat Forever’ is True (This will repeat the click activity untill it exists)
Also tick the ‘ContinueOnError’ property (This will move forward the flow once the element is gone)

Hello Freind,

I tried the On Element Appear, it clicked only once on the green button, but in my case i need it to click multiple times until the pop up disappears

Hi

Assign value = True

while (value)
{
check element exists

if element exists

        make a click 

If not ,

     change value = false

}

Have you tried this method? This will be more feasible in your case.

Yes, but it kept looping as you need to assign a condition to break the while.
so it didnt work

1 Like

i tried this, it kept looping

‘Do While’ Loop.
Keep your Click Activity and Element Exists both Inside the Do Block.
In the Condition of Do while Activity, provide the Boolean output from Element Exists Activity.

The Boolean Output in the above statement will work as break for you.
Initially when the green tick is present, the ‘Element Exists’ Output will be True, so the process will try again to click while the output is True.
Once the tick disappears, the element will not exist and the Output will be False, so now the while loop will not work and move ahead.

Please share the screenshot of the workflow u designed.

Hi

Element exists should come within the While loop .

Element exists .

If elements exists , then click ,
if element doesn’t exists ,override the Boolean value with false.

You need to basically check if the element exists for every iteration and based on the output of element exists , you need to make a click.

this is it
image

You have assigned the value=True in while condition, it will always throw as True (Infinite loop)

Please design as guided earlier

  • use ‘Do While’ Loop.
  • Keep your (Green tick)Click Activity and Element Exists both Inside the Body.
  • In the Condition Property of ‘Do while’ Activity, provide the output from Element Exists Activity.
1 Like

it worked thanks

1 Like

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