-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
I am experimenting with network data collector.
Simple code (C#/Selenium):
await using var collector = await bidi.Network.AddDataCollectorAsync([DataType.Response], 10000000);
await using var subscription = await bidi.Network.OnResponseCompletedAsync(async res =>
{
//await Task.Delay(300); // give a chance for remote-end to materialize data
Console.WriteLine((await bidi.Network.GetDataAsync(DataType.Response, res.Request.Request)).GetType());
});
await context.NavigateAsync("https://selenium.dev", new() { Wait = ReadinessState.Complete });Here I do:
- Enable data collector for responses
- Subscribe on
responseCompletedevent, and get data for the response as soon as event is raised
Sometimes, I get weird error from remote-end:
no such network data: No collected data for request ED804ADE49D4B69A470EDB66E5C0BE37
But, as soon as I add small delay (300ms) before getting response data, it works smoothly.
PS: this is for Chrome. Firefox works worse: unavailable network data: Network data content for request id 2 and DataType response is unavailable - raising more often.
Metadata
Metadata
Assignees
Labels
No labels