title: JAVA-Selenium: TimeoutException: Expected condition failed
body: <p>While working on code written in Java to automate clicking of a search button on a certain website, i have come across an interesting problem.</p>
  
  <p>The java code runs in loops and locates plus clicks the search button on every iteration. This works well for initial two-three iterations but then the code breaks. If i click on this web-element (a button) manually during execution before the breaking of code, everything works well.</p>
  
  <p>Command in Java:</p>
  
  <pre><code>WebElement shineWebElementSearchButton = shineWaitLocal.until(ExpectedConditions.elementToBeClickable(By.cssSelector("button[id=id_searchButton]")));
  shineWebElementSearchButton.click();
  WebElement shineWebElementSearchBoxPopUpField1 = shineWaitLocal.until(ExpectedConditions.elementToBeClickable(By.cssSelector("input[id=id_q]")));
  shineWebElementSearchBoxPopUpField1.sendKeys("Testing Automation Selenium Qa");
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>Exception in thread "main" org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: By.cssSelector: input[id=id_q] (tried for 30 second(s) with 500 MILLISECONDS interval)
  Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:26.402Z'
  System info: host: 'ADMIN-PC', ip: '192.168.2.8', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_161'
  Driver info: org.openqa.selenium.firefox.FirefoxDriver
  Capabilities [{moz:profile=C:\Users\admin\AppData\Local\Temp\rust_mozprofile.tYzdI4bJaghM, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, moz:headless=false, platform=XP, moz:accessibilityChecks=false, acceptInsecureCerts=true, browserVersion=57.0, platformVersion=10.0, moz:processID=8664, browserName=firefox, javascriptEnabled=true, platformName=XP, moz:webdriverClick=false}]
  Session ID: 89991b7d-9acd-485c-bc59-b537ece2af76
      at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:82)
      at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:231)
      at autoApplyShine.applyForJobs.applyForJobsFunctionality(applyForJobs.java:32)
      at autoApplyShine.ApplyShine.main(ApplyShine.java:28)
  </code></pre>