webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Element click doesn't wait for navigation in case of form submissions

Open whimboo opened this issue 6 years ago • 2 comments

Here the relevant part of the spec:

14.1 Element Click

  1. Perform implementation-defined steps to allow any navigations triggered by the click to start.

  2. Try to wait for navigation to complete.

The problem hereby is that eg. for clicking a submit button it is not guaranteed that the click will immediately cause a page navigation. In the case of a registered click event handler, the form submission can be delayed (or completely aborted by using preventDefault). In case of a delay, the click handler might trigger the form submission directly via form.submit().

Our page load strategy for click should be clarified in how to handle situations like those, which could happen a lot in the web. Especially when frameworks like Angular, or React/Redux are in use.

See https://github.com/mozilla/geckodriver/issues/1026 for an example.

whimboo avatar Nov 29 '17 19:11 whimboo

A simplified testcase can be found at: https://output.jsbin.com/pegefonizu

whimboo avatar Nov 29 '17 20:11 whimboo

@AutomatedTester is that something we should consider, or drop given that it adds a fair amount of complexity. I wonder how the old drivers behaved, because of those we kept the click + wait logic in the spec. CC'ing @barancev who might know something.

whimboo avatar Oct 30 '20 15:10 whimboo