title: Selenium webdriver explicit wait
body: <p>I'm writing some automated tests for using the selenium chrome driver. I trying to write a reusable method that will explicitly wait for elements to appear and then call this method in other classes. Seems pretty straight forward but its not doing what I want it do. Here is the method that I have. </p>
  
  <pre><code>public String waitForElement(String item) {
      WebDriverWait wait = new WebDriverWait(driver,30);
      WebElement element = wait.until(
                          ExpectedConditions.elementToBeClickable(By.id(item)));
      return item;
  }
  </code></pre>
  
  <p>Then I call the method and pass it a parameter like this:</p>
  
  <pre><code>waitForElement("new-message-button");
  </code></pre>
  
  <p>That doesn't seem to become working, can someone give some insight?</p>