-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
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