Skip to content

[🚀 Feature]: Implement high level BiDi script commands #13992

Open
@titusfortner

Description

@titusfortner

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() #14305 #14250
unpin() #14305 #14250
execute() #14330 #14293
addConsoleMessageHandler() #14225 #14135 #14107 #14073 #14057
removeConsoleMessageHandler() #14225 #14135 #14107 #14073 #14057
addDomMutationHandler() #14304 #14238
removeDomMutationHandler() #14304 #14238
addJavaScriptErrorHandler() #14225 #14135 #14107 #14073 #14057
removeJavaScriptErrorHandler() #14225 #14135 #14107 #14073 #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 the Script 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-devtoolsIncludes everything BiDi or Chrome DevTools relatedC-dotnet.NET BindingsC-javaJava BindingsC-nodejsJavaScript BindingsC-pyPython BindingsC-rbRuby BindingsI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions