How use while loop (insteed of waitForElementNotVisible)/set while loop time limit

sir i am using waitForElementNotVisible command with 5 seconds !TIMEOUT_WAIT limit for an loading (.gif) element and its work perfectly.
I read here (waitForVisible (and waitForNOTVisible), assertVisible, assertNotVisible - Selenium IDE Commands Tutorial) that UI.Vision RPA software decided to not support waitForElementNotVisible command to keep things lean.
So i decide to change my code into while loop method.
Sir my problem is that the loading (.gif) element which one i am checking for visibilty its gone between 1-2 seconds and while loop worked. but sometime its hang and showing animated loading.gif (site slow down issue or may be other issue) and while loop running continually. so i want to set timeout limit to while loop 5 second not to element.

Can you please post a link to a test website? Then we can create a macro that works for it.

sir its password protected site. i uploaded animated gif file.

Just to clarify this further: So you want to wait for this GIF to disappear?

yes sir, i want wait only 5-10 seconds to gif disappear . If this gif disappear within 5 seconds then continues to next command otherwise goto end of macro and start next loop.


  1. Put a counter in your while loop that increases with each iteration
  2. Put a wait ( think it’s called pause) of a couple of seconds or so
  3. Put an if statement if you counter hits a specific number call and just to a goto Label with a “Label” defined outside the while loop


use a “Times” loop of “10 iterations” or something and then same thing.
Inside the loop you can jump out with a “goto Label” if the images shows up.

Sir, there are five drop down menu when I select first dropdown menu second drop down menu value list update according first dropdown menu value I selected. Its take or seconds to update next drop down menu list. And same process for third drop down menu depend on second and fourth drop down menu depend on third value. After updating any dropdown menu it’s show that animated gif for 1-5 seconds (sometimes its hangs and GIF file showing/running continuously) . If I use while loop with counter and pause command it waste one second on every dropdown menu. If waitForElementNotVisible take 1.2 seconds while loop with pause its take 2.x.

I think while loop is not the best solution instead of waitForElementNotVisible cmd.So please don’t drop support for
waitForElementNotVisible cmd.