Waiting for an element to load in a web application that is refreshed multiple times


I have a web application where I will be searching for a number of items and wait until the page loads a specific element to capture it in an excel sheet. I have called a for each loop to take item from excel sheet, search in the page (by clicking search button) and wait&capture the element into same excel sheet. I am using “Element Exists” (Output=WindowExists) and an while loop checking for “WindowExists<>True”. Everything is fine until for most of the items, but for some cases there is a problem. I found out that there is a tiny delay from the time uipath clicks on search icon to the page begins loading the information of the new item. In that time gap UI path is capturing the details of previous item (UI path is accurate because the element seem to exists there) that was present. I gave a standard delay after clicking the search button, that worked fine, but i really do not want my code this kind of a delay. Please let me know what can be done to improve my code? Is there any way to wait for such element?

Hi @Pramod_V_Udupa,

You can use Wait Element Vanish activity (Wait not active and Wait not visible ticked) and this activity waits for the previous element to disappear, then you can check for the next element in the loop.
Hope this helps!

Happy coding! :slight_smile:

1 Like

Wait Element Vanish activity was not working for first loop iteration; The entire code used to stop abruptly without any error. So along with making Wait not active and Wait not visible TRUE, I also made continue on error to TRUE. Then all iterations worked as required (UIpath was able to capture the exact element for that specific item). I hope this change does not affect anything else on the program.

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