I have an issue when clicking on a button with Selenium 2.0b3 Java API with FirefoxDriver. Clicking on the button sends a form to the webserver and then browser goes to a new page as a result of the form submission.
When clicking on an element with element.click(), selenium is waiting for the browser to complete its operations. The browser waits until the page load is finished. But, sometimes the page load takes an enormous amount of time due to some advertisement requests.
How to work around the synchronisation between element.click() and the page load?
EDIT:
As explained in the WebElement javadoc:
Click this element. If this causes a new page to load, this method will block until the page has loaded.
Thanks