title: Selenium webdriver can't find button
body: <p>EDIT:
  I have cleaned this up a bit.</p>
  
  <p>I have a button that looks like this:</p>
  
  <pre><code>&lt;input id="applyRuleButton" class="Button" name="filtersContainer:applyRuleButton"
   value="Apply" onclick="wicketShow('applyRuleButton--ajax-indicator');var
   wcall=wicketSubmitFormById('id256', '?wicket:interface=:23:form:filtersContainer:applyRuleButton:
  :IActivePageBehaviorListener:0:&amp;amp;wicket:ignoreIfNotActive=true',
   'filtersContainer:applyRuleButton' ,function() { ;wicketHide('applyRuleButton--
  ajax-indicator');}.bind(this),function() { ;wicketHide('applyRuleButton--
  ajax-indicator');}.bind(this), function() {return
   Wicket.$$(this)&amp;amp;&amp;amp;Wicket.$$('id256')}.bind(this));;; return false;" type="submit"&gt;
  </code></pre>
  
  <p>Firebug:</p>
  
  <pre><code>    &lt;input id="applyRuleButton" class="Button" type="submit" 
  onclick="wicketShow('applyRuleButton--ajax-indicator');var 
  wcall=wicketSubmitFormById('id2ee', 
  '?wicket:interface=:29:form:filtersContainer:applyRuleButton::IActivePageBehaviorListener:0
  :&amp;wicket:ignoreIfNotActive=true', 'filtersContainer:applyRuleButton' ,function() { 
  ;wicketHide('applyRuleButton--ajax-indicator');}.bind(this),function() { 
  ;wicketHide('applyRuleButton--ajax-indicator');}.bind(this), function() {return 
  Wicket.$$(this)&amp;&amp;Wicket.$$('id2ee')}.bind(this));;; return false;" value="Apply" 
  name="filtersContainer:applyRuleButton"&gt;
  </code></pre>
  
  <p>I'm trying to click it and have tried pretty much everything for 2 days, webdriver does not find the element, IDE does find it:</p>
  
  <p>//This was my first approach, it should work.
  It works in IDE, but not Webdriver:</p>
  
  <pre><code>driver.findElement(By.id("applyRuleButton")).click();
  </code></pre>
  
  <p>//then perhaps this should do the trick, hint: It doesn't:</p>
  
  <pre><code>WebElement element3 = driver.findElement(By.id("applyRuleButton"));
  JavascriptExecutor executor3 = (JavascriptExecutor)driver;
  executor3.executeScript("arguments[0].click();", element3);
  </code></pre>
  
  <p>Ok, Id not working, I get it.
  Then this should work at least:</p>
  
  <pre><code>driver.findElement(By.xpath("//table/tbody/tr/td/div/div/table/tbody/tr[6]/td/input[@id='applyRuleButton']")).click();
  </code></pre>
  
  <p>It feels like I am missing something obvious here, some help please?</p>
  
  <p>Additional information:</p>
  
  <p>I have added a 5 second wait, the page is completely loaded.</p>
  
  <p>This button is located in a table:
  <img src="https://i.stack.imgur.com/OPvE2.png" alt="enter image description here"></p>
  
  <p>The Xpath is </p>
  
  <pre><code>/html/body/div[4]/div[2]/form/div[3]/div/div/table/tbody/tr/td/div/div/table/tbody/tr[6]/td/input
  </code></pre>
  
  <p>Webdriver error, no matter what I throw at it, is: Unable to locate element</p>
  
  <p>I have used both 'click' and 'submit', still no success.</p>