Ajax button redirecting on Selenium webdrivers <p>I'm trying to test a site like <a href="http://www.doubledaybookclub.com/checkout/cart/" rel="nofollow">sample</a> and get different outcomes when clicking a button. When running selenium webdriver's --firefox and chrome-- I get redirected after this click:</p> <pre><code>@driver.find_element(css: "#shipping-zip-form .button.small").click </code></pre> <p>However, if i go to the site and run the following command in the console, I do not get redirected.</p> <pre><code>jQuery('#shipping-zip-form .button.small').click(); </code></pre> <p>What is causing redirects to the homepage when running on through selenium? A thread.sleep command won't work and wait_until isn't working either. My guess is that something is happening too fast...</p>