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

[🐛 Bug]: Network interception freeze whole application for request when content-type = raw #14547

Open
maciekpazola opened this issue Sep 30, 2024 · 4 comments

Comments

@maciekpazola
Copy link

What happened?

After updating Selenium from version 4.23 to 4.24 or 4.25, I encountered an issue where I can no longer capture a specific request within the application. This request is responsible for sending a file to the backend with a content type set as raw.

Although I don't receive any exceptions from Selenium, the tests seem to freeze because selenium blocks the request from complete. Since I'm tracking network requests asynchronously, the test ultimately fails on a different assertion.

The same scenarios works correctly manually and on 4.23 selenium version.
Issue appear appear both on chrome and edge.

request as curl:
curl "http://t1.vie1qacl113/theservice/v0001/restun/UploadSessionAppendChunkRaw" ^ -H "Accept: application/json, text/plain, */*" ^ -H "Accept-Language: en" ^ -H "Authorization: [TokenValue]" ^ -H "Connection: keep-alive" ^ -H "Content-Type: raw" ^ -H "Cookie: MixedSecurity._strReturnUrl=/Client/WEB/Main.aspx; ASP.NET_SessionId=olgs43wzcg3mh1vhgzrbcsbz" ^ -H "Origin: http://t1.vie1qacl113" ^ -H "Referer: http://t1.vie1qacl113/tdwv/" ^ -H "TenantName: t1" ^ -H "The-Client-Type: 19" ^ -H "The-Timezone-IANA: Europe/Vienna" ^ -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" ^ -H "X-The-UploadSession-ChunkPosition: 0" ^ -H "X-The-UploadSession-Id: 664ca222-888c-4ca1-9f52-46af77b82adb" ^ --data-raw [File Content]

How can we reproduce the issue?

Intercept traffic in application and then try to catch a request which send a file as raw.

Relevant log output

I've not found any logs in logtype.browser or driver on minimum log level trace

Operating System

win 11

Selenium version

.net 4.24

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

Chrome 129

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

Using newest drivers with seleniumdrivermanager

Are you using Selenium Grid?

No response

Copy link

@maciekpazola, 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!

@nvborisenko
Copy link
Member

Let's compare internal selenium logs and try to find out any difference: https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/

@maciekpazola
Copy link
Author

Let's compare internal selenium logs and try to find out any difference: https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/

The main difference I noticed is that in version 4.24, there are multiple 404 error logs:

TRACE HttpCommandExecutor: << StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Cache-Control: no-cache
  Content-Length: 1073
  Content-Type: application/json; charset=utf-8
}

Logs:
SeleniumLog_Selenium4.23_Passing.txt
SeleniumLog_Selenium4.24_Failing.txt

@nvborisenko
Copy link
Member

Nothing interesting in logs, I guess 404 is side effect caused by incorrect network interception.

What I can propose:

  • Selenium team will add more internal logging around CDP commands
  • You can try to capture all CDP interactions via try { // execute your network continuation here } catch(Exception ex) { // capture it somewhere, to console? }. All event handlers are invoked like "fire and forget", probably introducing try/catch block we will see something useful.

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

2 participants