you use watir-webdriver right? wait_while_present uses present? under the hood which checks exists? && visible? so this should do the trick ...
wait_while_present has a timeout parameter which defaults to 30 sec .. is this sufficient? wrap it in a begin rescue & see if you get a TimeoutError ..if so, try .wait_while_present(an integer big enough for your app) Also, browser.div(:id => 'spinner').image(:src => / loading.gif/).wait_while_present is probably more efficient because of the way watir-webdriver locates elements On Feb 17, 7:46 am, RJ <rj412....@gmail.com> wrote: > how do I wait until this element disappears or is set to hidden again? > > <div id="spinner_container"> > <div id="spinner" style="visibility: hidden;"> > <img vspace="1" align="absmiddle" src="../images/loading.gif" > style="margin-bottom: 1px;"/> > </div> > </div> > > I already tried the following without much success: > > browser.image(:src => /loading.gif/).wait_while_present > AND/OR > browser.div(:id => 'spinner').image(:src => / > loading.gif/).wait_while_present -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com