Motivation
The problem is in fact that click() and submit() don't support waiting for page to load.
See for details: http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_WebDr....

Possible solutions
So our task is to determine what could be used as a mark that the page is refreshed with new content.
Please note:

  • Executing JavaScript like this:
    return (document.readyState === 'complete');
    is not the solution since JavaScript is single-threaded and couldn't be used for synchronous check.
  • I've also tried a cycle in PHP, which uses JavaScript to check the state.

Now it is done just via sleep(1) on 10-second timeout.
Search for "function waitForElements" here : http://drupalcode.org/project/selenium.git/blob/refs/heads/7.x-3.x:/drup....
It works - but I don't think it is flexible enough solution.