SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.23k stars 8.12k forks source link

[🐛 Bug]: Pages are much slower to load when Network monitoring is enabled #14300

Open mmalandra-kb4 opened 1 month ago

mmalandra-kb4 commented 1 month ago

What happened?

When using dotnet bindings with network monitoring enabled, pages with a lot of network calls can be extremely slow to load.

driver.Quit(); Relevant log output

Operating System

Selenium version 4.22

What are the browser(s) and version(s) where you see this issue? Chrome

What are the browser driver(s) and version(s) where you see this issue?

Are you using Selenium Grid? This occurs with and without grid.

How can we reproduce the issue?

using OpenQA.Selenium.Chrome;

var driver = new ChromeDriver();

var network = driver.Manage().Network;

await network.StartMonitoring();

driver.Url = "https://yahoo.com";

Relevant log output

There are no logs related to this, but if you compare the time it takes for the page to load with monitoring enabled vs disabled, it can be different by a magnitude of about 10-20x.

Operating System

MacOS/Linux

Selenium version

dotnet 4.22

What are the browser(s) and version(s) where you see this issue?

Chrome 126

What are the browser driver(s) and version(s) where you see this issue?

chromedriver 126

Are you using Selenium Grid?

Occurs with and without grid (

github-actions[bot] commented 1 month ago

@mmalandra-kb4, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

diemol commented 1 month ago

@nvborisenko, do you know why this could happen?

nvborisenko commented 1 month ago

I reproduced it with listening to network traffic via CDP, and via BiDi.

The issue is not reproducible in Firefox browser - everything works smoothly (BiDi implementation). Sometimes it works smoothly in Chrome. But each time when page loads slower than usual I see strange error in chromedriver:

[7060:9628:0729/190802.723:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -100
[7060:9628:0729/190802.746:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -100
[7060:9628:0729/190803.622:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101

No issues in selenium code. This issue can be easily reproduced on https://yahoo.com page, not on https://youtube.com

@mmalandra-kb4 if you observe the similar symptoms, then this issue should be addressed by chrome webdriver team.

mmalandra-kb4 commented 1 month ago

I'll try with other bindings first to see if this is potentially something related to the dotnet code exclusively.