Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🚀 Feature]: Implement high level BiDi network commands #13993

Open
titusfortner opened this issue May 21, 2024 · 2 comments
Open

[🚀 Feature]: Implement high level BiDi network commands #13993

titusfortner opened this issue May 21, 2024 · 2 comments

Comments

@titusfortner
Copy link
Member

titusfortner commented May 21, 2024

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 network() method available directly from the Driver class (e.g., driver.network.addRequestHandler(), driver.network().addRequestHandler()). 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
addRequestHandler()
removeRequestHandler()
clearRequestHandlers()
addResponseHandler()
removeResponseHandler()
clearResponseHandlers()
addAuthenticationHandler()
addJavaScriptErrorHandler()
removeAuthenticationHandler()
clearAuthenticationHandlers()

Considerations:

If we can figure out how to get the "add" methods return an id that can be used by the "remove" methods, that would be a lot easier for or users. Might be too complicated to implement.

@titusfortner
Copy link
Member Author

I've been thinking about this, and I think the add methods should return an id. This is going to be much easier for languages that want to pass in lambdas without storing a reference to the location os the object in memory.

This is how moz/addon/install endpoint works and the id gets passed into the payload to remove the addon.

I was looking for common wisdom here and it generally seems to match — https://softwareengineering.stackexchange.com/questions/314066/restful-api-should-i-be-returning-the-object-that-was-created-updated

@p0deje
Copy link
Member

p0deje commented May 28, 2024

I've been thinking about this, and I think the add methods should return an id. This is going to be much easier for languages that want to pass in lambdas without storing a reference to the location os the object in memory.

Totally fine by me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants