webdriver
webdriver copied to clipboard
Element click doesn't wait for navigation in case of form submissions
Here the relevant part of the spec:
14.1 Element Click
Perform implementation-defined steps to allow any navigations triggered by the click to start.
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.
A simplified testcase can be found at: https://output.jsbin.com/pegefonizu
@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.