title: Loop actions until an element is no longer visible
body: <p>Im trying to loop a set of actions until an element is not longer visible. I have a list of elements on a  table and when i delete one (using the actions mentioned) the previous one moves to the top of the table. The element on top always has the same xpath so I am just trying to remove the top element over and over until none remain. Im currently using the following method but it only removes the first element. Ive tried to use .size() but i get an error, any ideas?</p>
  
  <pre><code>public static void rieAllcards() {
      if (firstCard.isDisplayed()) {
          //Allow RIE to Open
          clickToExpandCard();
          clickEditIcon();
          clickRemove();
  
      } else {
  
          System.out.println("Element not present");
      }
  
  }
  </code></pre>
  
  <p>the element "firstCard" is replaced with the second card on the list, this will continue until "FirstCard" is no longer there and the method should allow the test to move on.</p>