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 26266 - Webdriver command batches suggestion
Summary: Webdriver command batches suggestion
Status: NEW
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Browser Testing and Tools WG
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 24121
  Show dependency treegraph
 
Reported: 2014-07-04 14:34 UTC by Anton Zhuravsky
Modified: 2015-10-26 03:45 UTC (History)
2 users (show)

See Also:


Attachments

Description Anton Zhuravsky 2014-07-04 14:34:17 UTC
Hi guys,

I have recently encountered an challenge while implementing automated tests and think we can design a pretty useful generic feature out of it.

The idea is pretty simple: create an interface to be able to create a batch of commands and get a notification upon their completion. So, basically the approach is:
1) An API consumer requests WebDriver to notice batch start
2) WebDriver replies with a unique batch id
3) All the commands executed later on are associated with this batch
4) An API consumer requests WebDriver to notice batch finish
5) An API consumer is able to ask if the batched commands have been completed
6) (Optional) WebDriver can notify API consumer about batch finalization

The motivation behind this is pretty simple: executing some actions can produce delayed side effects (send an AJAX request and handling a callback once it finishes; submitting the form into an iframe and handling onload event; etc). Unfortunately, currently there is no way to know that a command (or a set of commands) have finished working completely (including all side effects produced directly or indirectly by them). 

Why do we need this is real world? Well, a number of examples can be provided: the simpliest is writing automated tests for javascript code, which requires asserting some values only after all asynchronous activity has completed.

Please note it is different from page loading modes as the effects are not limited to network / parser / DOM – one can set a delayed executing (via setTimeout) and aim to check if it worked properly (and, of course, only after setTimeout has fired), which gets handled by the proposed functionality.

If anyone could provide his thoughts on the suggestion it would be great – I am keen to discuss and polish the design of this feature :)