def with_nullpointer_retry(max_retries = 3)
      tries = 0
      yield
    rescue java.lang.NullPointerException => e
      raise e if tries >= max_retries

      tries += 1
      warn "warning: celerity caught #{e} - retry ##{tries}"
      retry
    end
def with_nullpointer_retry(max_retries = 3)
      tries = 0
      yield
    rescue java.lang.NullPointerException => e
      raise e if tries >= max_retries

      tries += 1
      warn "warning: celerity caught #{e} - retry ##{tries}"
      retry
    end
HtmlUnit throws NPEs sometimes when we're locating elements
 Retry seems to work fine.