selenium: [π Bug]: IWebDriver.Manage().Network.StartMonitoring() causes file uploads to fail
What happened?
I have a project that uploads files into the web app under test on the Chrome browser. With Selenium 4.23 this was working flawlessly. I tried to update to Selenium 4.27 and with no changes other than this NuGet package version this stopped working.
The implementation of the web app under test is such that when files are uploaded this is done in 4MB chunks. If the file size is less than 4MB then the upload still works as it used to with 4.23. However if the size is greater than 4MB such that it is chunked then the upload will not work anymore.
Narrowing it down I eventually find that it is a call to IWebDriver.Manage().Network.StartMonitoring() that appears to be the cause. If I remove this line it works fine, with it it will not do the upload.
How can we reproduce the issue?
Here is a simple example to see the issue. Note that this is not the site I was testing, I cannot give you access to that, but this one appears to show the issue too. Note here I donβt know the chunking size for this site but I was observing failure using a file that was 80MB and seeing success with a file that was 1KB.
IWebDriver driver = null;
try
{
driver = new ChromeDriver();
driver.Manage().Network.StartMonitoring().GetAwaiter().GetResult();
driver.Navigate().GoToUrl("https://tus.io/demo");
Thread.Sleep(1000);
driver.FindElement(By.Id("P0-0")).SendKeys("C:\\Users\\YourName\\file.file");
Thread.Sleep(22000);
}
finally
{
driver?.Quit();
}
Relevant log output
Trace level driver logs are 200MB so cannot upload or paste in here. Please download from: https://www.filemail.com/d/xbkqrdjzsxgdvms
Operating System
Windows 10
Selenium version
4.27.0
What are the browser(s) and version(s) where you see this issue?
Chrome 131.0.6778.140
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 131.0.6778.140
Are you using Selenium Grid?
I was but seems not necessary to reproduce the issue
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (11 by maintainers)
Commits related to this issue
- [dotnet] [cdp] Add more internal logs around CDP implementation Related to #14903 — committed to nvborisenko/selenium-hq by nvborisenko 2 years ago
- [dotnet] [cdp] Add more internal logs around CDP implementation Related to #14903 — committed to sandeepsuryaprasad/selenium by nvborisenko 2 years ago
I caught it:
(modified
postDataproperty).The issue is not reproducible in Selenium v4.23 where
Newtonsoft.Jsonis used for deserialization, and begins to be reproducible in v4.24 whereSystem.Text.Jsonis used.