title: java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;
body: <p>I hit the following error whenever I try to use <code>wait.until(ExpectedConditions)</code> in my project:</p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;</p>
  </blockquote>
  
  <p>Sample code which I see issue with :</p>
  
  <pre><code>public static void clickSearch(WebDriver driver,By by, int timeout){
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
      WebDriverWait wait = new WebDriverWait(driver, 2);
      WebElement webElement = wait.until(ExpectedConditions.elementToBeClickable(by));
      driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
      webElement.click();
  }
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>FluentWait&lt;WebDriver&gt; wait = new FluentWait&lt;WebDriver&gt;(driver).withTimeout(waitSeconds, TimeUnit.SECONDS).pollingEvery(5, TimeUnit.SECONDS) .ignoring(NoSuchElementException.class);
  wait.until(new ExpectedCondition&lt;Boolean&gt;() {
        @Override
        public Boolean apply(WebDriver driver) {
            return ((JavascriptExecutor) driver).executeScript("return document.readyState").toString().equals("complete");
        }
  });
  </code></pre>
  
  <p>I have got the following libraries:</p>
  
  <pre><code>activation.jar
  byte-buddy-1.8.3.jar
  cglib-nodep-3.2.4.jar
  commons-codec-1.10.jar
  commons-collections4-4.1.jar
  commons-exec-1.3.jar
  commons-io-2.5-javadoc.jar
  commons-io-2.5.jar
  commons-lang3-3.5.jar
  commons-logging-1.2.jar
  dom4j-1.6.1.jar
  dsn.jar
  gson-2.8.5.jar
  hamcrest-core-1.3.jar
  hamcrest-library-1.3.jar
  http-client-6.6.0.5.jar
  httpclient-4.5.5.jar
  httpcore-4.4.9.jar
  httpmime-4.5.5.jar
  imap.jar
  jackson-annotations-2.9.1.jar
  jackson-core-2.9.1.jar
  jackson-databind-2.9.1.jar
  java-client-3.3.0.jar
  jaxen-1.1.6.jar
  jcl-over-slf4j-1.7.21.jar
  jcommander-1.72.jar
  jna-4.4.0.jar
  json-20151123.jar
  jsr305-3.0.2.jar
  junit-4.12.jar
  jxl-2.6.12.jar
  mail.jar
  mailapi.jar
  netty-3.5.7.Final.jar
  ojdbc6.jar
  okio-1.15.0.jar
  pm-webdriver-6.6.0.5-javadoc.jar
  pm-webdriver-6.6.0.5.jar
  poi-3.17.jar
  poi-examples-3.16.jar
  poi-excelant-3.17.jar
  poi-ooxml-3.17.jar
  poi-ooxml-schemas-3.17.jar
  poi-scratchpad-3.17.jar
  selenium-3.13\selenium-api-3.13.0.jar
  selenium-3.13\selenium-java-3.13.0.jar
  selenium-3.13\selenium-remote-driver-3.13.0.jar
  selenium-3.13\selenium-server-standalone-3.13.0.jar
  selenium-3.13\selenium-support-3.13.0.jar
  slf4j-api-1.7.25.jar
  smtp.jar
  testng-6.14.2.jar
  xml-apis-2.9.1.jar
  xmlbeans-2.6.0.jar
  guava-26.0-jre.jar
  </code></pre>
  
  <p>We dont use Gradle/Maven in our project. We store the physical copy of these libraries in a location and use the same to build an executable jar using ANT script. And we execute the jar created by ANT script from command line:</p>
  
  <pre><code>java.exe -cp &lt;ProjectJarName&gt;;&lt;Location of jar libraries&gt; &lt;Main class name with whole package&gt;.
  For eg : java.exe project.jar;C:\Libraries\*.jar java.main.Main
  </code></pre>
  
  <p>When I searched for the issue, the common answer I saw was adding latest guava jar which I have tried and it didn't solve the issue. Also in selenium forum in github, I see people solving the issue by making changes in pom.xml by changing the order which I don't think I have to do as I am not depending on maven.</p>