3 ms·
WebDriver provides a standardized interface for automating web browsers. It makes building out automated cross-browser tests easier, since you can utilize all t
by jodoherty 5y ago
WebDriver provides a standardized interface for automating web browsers. It makes building out automated cross-browser tests easier, since you can utilize all the browsers in the same way if they support it. It's mostly confined to use in automation and testing, not something a webpage would use with your browser as you browse the web.
Currently, the protocol is request/reply from the client to the browser, so if you do commands involving a page and want to wait for something to appear (a dialog, a confirmation message, a notification, a changed element, etc.), you'd have to check the page over and over again in a loop of commands to inspect the page's state to see if the change happened. This BiDirectional spec would allow you to execute commands that tell the client to send commands back when certain browser events or DOM changes happen, allowing you to specify a callback handler that happens when the event triggers rather than having to poll with a loop.
This makes implementing tests much easier and more consistent. One weakness of polling, for example, is that if something changes on the page and then changes back between your checks, then it'll appear as though it never happened. The BiDi spec makes it so you get events for the changes without having to worry about polling rates.