title: How can I click on a button using Selenium WebDriver with Java?
body: <p>The following is the HTML code for button:</p>
  
  <pre><code>&lt;span&gt;
  &lt;button class="buttonLargeAlt" onclick="javascript:submitCheckout(this.form);"type="submit"&gt;Checkout&lt;/button&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>I tried <code>driver.findElement(By.xpath("//span[contains(.,'Checkout')]")).click();</code></p>
  
  <p>It is not working...</p>
  
  <p>Any other ideas? There are 2 buttons with same name on the page.</p>