-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Comments
I've been thinking about this, and I think the This is how 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 |
Totally fine by me! |
Can someone help refresh my memory on the "addRequestHandler()"? - I vaguely remember us discussing the current C# implementation using the matcher and transformer https://github.com/SeleniumHQ/seleniumhq.github.io/blob/c6769ef064d8bc3ffb6343fba3c10ab4ddbad78c/examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs#L85. Is that what we want? How would that look like? |
I might be wrong, but IIRC the idea was to let
|
I guess var subscription = await context.Network.OnBeforeRequestSentAsync(Console.WriteLine);
await context.NavigateAsync("https://selenium.dev");
await subscription.UnsubscribeAsync(); Or network interception: await using var intercept = await context.Network.AddInterceptedRequestAsync(async args =>
{
await args.Request.Request.ContinueAsync(new() { Method = "POST" });
});
|
Can I use the INetwork-NetworkResponseReceived feature in Selenium. WebDriver version 4.24.0 in Firefox? |
@bogishvili I understand your use case here. However, we can support what is available in the WebDriver BiDi spec https://w3c.github.io/webdriver-bidi/#module-network. Currently, there is no way defined to get the request and response bodies. There is an issue to track this though w3c/webdriver-bidi#747. So this can be supported in the future once it is present in the spec and supported by the browsers. |
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:
addRequestHandler()
removeRequestHandler()
clearRequestHandlers()
addResponseHandler()
removeResponseHandler()
clearResponseHandlers()
addAuthenticationHandler()
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.
The text was updated successfully, but these errors were encountered: