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]: issue in managed download java example #14479

Open
amardeep2006 opened this issue Sep 7, 2024 · 2 comments
Open

[🐛 Bug]: issue in managed download java example #14479

amardeep2006 opened this issue Sep 7, 2024 · 2 comments

Comments

@amardeep2006
Copy link

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

Copy link

github-actions bot commented Sep 7, 2024

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

@harsha509 harsha509 transferred this issue from SeleniumHQ/seleniumhq.github.io Sep 8, 2024
@diemol
Copy link
Member

diemol commented Nov 5, 2024

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

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