Open
Description
Feature and motivation
At the Selenium Dev Summit we agreed on this API to be generally applied across the bindings; we'll keep this labeled beta while we make sure that it works for what is needed
We want the methods to be accessible from a script()
method available directly from the Driver
class (e.g., driver.script.pin(script)
, driver.Script().Pin(script)
). We can't do everything just like this in all the languages, because, for example, .NET uses events with a +=
and -=
for adding and removing handler events so we don't went "add" and "remove" methods.
Implementations:
Method | Java | NodeJS | Python | Ruby | .NET |
---|---|---|---|---|---|
pin() |
✅ |
✅ |
|||
unpin() |
✅ |
✅ |
|||
execute() |
✅ |
✅ |
|||
addConsoleMessageHandler() |
✅ |
✅ |
✅ |
✅ |
#14057 |
removeConsoleMessageHandler() |
✅ |
✅ |
✅ |
✅ |
#14057 |
addDomMutationHandler() |
✅ |
✅ |
|||
removeDomMutationHandler() |
✅ |
✅ |
|||
addJavaScriptErrorHandler() |
✅ |
✅ |
✅ |
✅ |
#14057 |
removeJavaScriptErrorHandler() |
✅ |
✅ |
✅ |
✅ |
#14057 |
Considerations
- some of these "script" methods are in the "log" domain in BiDi spec, but "log" is overloaded and we were concerned that it would not be obvious what
driver.log()
was supposed to give access to. As such we agreed it would work well in theScript
implementation - we agreed to split out console messages from javaScript errors even though both come through the same BiDi method
- we agreed not to have an async version of execute method in the BiDi API