title: How to setup Thread.sleep to be a random number (Selenium Java)
body: <p>Quite simple question, however, I have trouble with this. I want to use sleep.thread to click on buttons in a random range of numbers, for example 30-50 seconds. This must be a sleep command. There is  a loop that clicks on the elements and my attempt to do that(I found this in another answer, not working for me)</p>
  
  <pre><code>List&lt;WebElement&gt; textfields = driver.findElements(By.className("_84y62"));
  
  
      System.out.println("total buttons " + textfields.size());
  
          for (WebElement e : textfields) {
              e.click();
  
                  Thread.sleep((long)(Math.random() * 11 + 10));
              }
  </code></pre>