This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Rather than having a global timeout setting for async scripts, it might make things easier to include an optional timeout parameter. For many use cases of executeAsyncScript, I am basically forced to reset the async script timeout before every time I call it as it I don't necessarily know that it hasn't been reset by some other code (note, I am usually building testing infrastructure on top of WebDriver, not tests themselves). If I could include a timeout, this would allow me to set it for a particular call as needed and not have to worry about overriding the current default value, while saving me a WebDriver request.
I would extend this to say that *every* command that may time out should have an optional timeout parameter that overrides whatever default was set for the session. The global timeouts are error-prone, especially since at least the implicit wait timeout gets reset by current Selenium servers when a page load occurs (see #26900). Being able to specify the implicit timeout on each request avoids any possible race condition, eliminates statefulness (which isn’t supposed to be in a REST API), and also reduces the number of HTTP calls that must occur when using many different timeouts.
We are going to add Get Timeout so you'll be able to get/set/reset the timeout for a specific command. That seems equivalent (albeit with more HTTP overhead)
(In reply to James Graham from comment #2) > That seems equivalent (albeit with more HTTP overhead) FWIW: 1. HTTP overhead is significant for cloud providers; this will effectively double RTT per command-with-timeout; 2. This still leaves open the possibility of race condition if someone wants to execute two different scripts (or find two elements, or any other commands that might be logically parallelised) concurrently. So a Get Timeout is not equivalent, especially in case #2 (which is not possible now, but *should* be). It’s also a totally useless feature for test authors and WebDriver client authors; *nobody* cares what the server thinks are the timeouts, they only care about how long each of their commands takes before timing out.