selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: issue in managed download java example

Open amardeep2006 opened this issue 1 year ago • 1 comments

What happened?

I am following the managed download example from https://www.selenium.dev/documentation/grid/configuration/cli_options/#start-the-node-with-manage-downloads-enabled and facing error as it tries to read JPG image instead of txt file.

This behavior become more evident when I did some more test with 5 to 7 files and seems like /session/<sessionid>/se/files does not return the list of files in some particular order. I could not identify the pattern by sorting order seemed random to me.

error while trying to read content of jpg file.

Caused by: java.nio.charset.MalformedInputException: Input length = 1 at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:279) at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:384) at java.base/sun.nio.cs.StreamDecoder.lockedRead(StreamDecoder.java:215) at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:169) at java.base/java.io.InputStreamReader.read(InputStreamReader.java:188) at java.base/java.io.BufferedReader.fill(BufferedReader.java:160) at java.base/java.io.BufferedReader.implReadLine(BufferedReader.java:370) at java.base/java.io.BufferedReader.readLine(BufferedReader.java:347) at java.base/java.io.BufferedReader.readLine(BufferedReader.java:436) at java.base/java.nio.file.Files.readAllLines(Files.java:3395)

I can raise a PR if you think my understanding is correct and we can decouple the list and download logic. We simple hardcode the file name while making download POST call instead of reading from List based on index. If you think there is a better way to fix the issue , pls suggest approach.

What browsers and operating systems are you seeing the problem on?

Selenium java 4.24.0 version with selenium grid 4.24.0

amardeep2006 avatar Sep 07 '24 10:09 amardeep2006

@amardeep2006, 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.

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

Thank you!

github-actions[bot] avatar Sep 07 '24 10:09 github-actions[bot]

It is hard to completely understand the issue when a sample code is not provided and most of the template is deleted.

diemol avatar Nov 05 '24 11:11 diemol

This issue was closed because we did not receive any additional information after 14 days.

github-actions[bot] avatar Nov 19 '24 20:11 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 19 '24 22:12 github-actions[bot]