Exiting from while loop if element exists

Hi ,

In my usecase, i need to check if the element exists or not. But the element appreas in 3 mins sometimes and sometimes it takes 10 mins and so on. it depends on the transactions we input. So now i used while loop for this case. If the element exits the loop has to break. How can i modify it here.

Hi @Sirisha_Siri,

use do-while.

Like this :point_down:.
image

Happy Learning,
Achal Sharma

i need to keep the delay activity in the while loop as well until the element appear.

we can use following activity for this scenario

well, it’s a dynamic delay. And it will break the loop once the element appears on the screen.

I gave delay of 3 min in interval of 5 so that it checks for every 3 mins if the element exits or not. So in the condition i gave the value of delay count to be checked. but how can i exit if the element exists activity is true.

HI @Sirisha_Siri

You can try with these activity it will wait until the Image or element appear in the screen

  • On element appear - if you are able to access that element of the status word like “Pending” or “Responded” you can make use of this activity. You can increase the TimeoutMS value in this activity properties to the minutes you want. But the beauty is the process wont wait till the time you mention in TimeoutMS, rather will continue the process, the moment [robot]
  • Wait attribute - Again this activity will apply only if you can access the element as mentioned above and is the most reliable one for your case. Because you can wait till the attribute value of “aastate” gets changes to “Responded” from “Pending”. Once this string is met with the attribute, you can proceed further. Again you can mention the TimeoutMS as you want.
  • On image appear - if you are not able to access the element of those strings, you can use this image activity. Once the image of the string “Responded” is found you can continue further and again you can mention the TimeoutMS as required.

Regards
Gokul

Use this experssion in while condition.
cint(in_Config("delayvar")) <=cint(in_Config("delaycount")) and ElementExistOutput=false

retry scope is doing this out of the box and can be configured on this.

a isTrue Activity (needed for the retry scope condition) is offered by following package:

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