This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25100 - [WebDriver Spec]: Change suggestion: include timeout parameter with executeAsyncScript
Summary: [WebDriver Spec]: Change suggestion: include timeout parameter with executeAs...
Status: RESOLVED WONTFIX
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: Browser Testing and Tools WG
QA Contact: Browser Testing and Tools WG
URL: https://dvcs.w3.org/hg/webdriver/raw-...
Whiteboard:
Keywords:
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2014-03-19 23:35 UTC by Marc Fisher
Modified: 2015-10-26 02:32 UTC (History)
3 users (show)

See Also:


Attachments

Description Marc Fisher 2014-03-19 23:35:27 UTC
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.
Comment 1 csnover 2014-09-24 21:31:28 UTC
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.
Comment 2 James Graham 2015-10-26 02:11:40 UTC
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)
Comment 3 csnover 2015-10-26 02:32:13 UTC
(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.