- Newest
- Most votes
- Most comments
So far our solution has been "Don't use Device Farm"
We wanted to try one workaround but it would have been a decent amount of work without a guarantee that it would even work: Basically we'd upload our test assets somewhere, then have the test machines download them at the beginning of the test (ie: actually making this a part of the test). This works around the issue of transferring the files to the runner, but we decided to stick with our current selenium grid provider instead of pursuing this for now.
Hello,
Thank you for reaching out to us.
Kindly allow me to address your query below :
I would like to inform you that the endpoint 'session/<sesssion_id>/se/file' is not a supported Selenium W3C endpoint. Currently, only chromedriver and edgedriver support files uploads, and the endpoint used to upload files is 'session/<sesssion_id>/file'.
In order to use this endpoint please ensure the following:
- Selenium is running version 3.14.x or 4.x
- Use the “LocalFileDetector” to upload local files.
Here is an example using the “LocalFileDetector”:
LocalFileDetector detector = new LocalFileDetector(); driver.setFileDetector(detector);
File localFile = detector.getLocalFile("<your_filename>"); WebElement uploadElement = driver.findElement(...);
uploadElement.sendKeys(localFile.getAbsolutePath());
Also, Selenium 4.0.0-alpha-1 version and mentioned that in version 4 currently only Selenium ‘4.0.0-alpha-1’ would work to upload the file.
LocalFileDetector detector = new LocalFileDetector(); driver.setFileDetector(detector);
File localFile = detector.getLocalFile("<your_filename>"); WebElement uploadElement = driver.findElement(...);
uploadElement.sendKeys(localFile.getAbsolutePath());
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.0.0-alpha-1</version> </dependency>
Kindly note, the chromedriver and edgedriver implements their own /file endpoint, so the above posted workaround will work for both chrome and edge tests, but not for firefox nor IE.
Thus, as a temporary solution, I would suggest you to switch to Selenium 3.14.x or ‘4.0.0-alpha-1’
Moving ahead, regarding the feature release of the implementation of /se/file with Selenium 4 API to be compliant with Device Farm, I completely understand that the lack of the feature is causing inconvenience however please note since this feature request is with the team, thus it is up to the team as to if/when this potential feature is implemented, and due to the confidentiality of upcoming AWS services and features, we as Support Engineers have limited visibility into the progress of it. Due to this, I'm afraid I won’t be able to provide an ETA regarding its release. You may refer to the What's new with AWS page which will note if such a feature does launch in future [1].
Thank you for your cooperation. We hope this information proves helpful.
Hope you have a great day ahead and Stay Safe!
References
We are currently using Selenium 4.8.3 with the LocalFileDetector.
Also, Selenium 4.0.0-alpha-1 version and mentioned that in version 4 currently only Selenium ‘4.0.0-alpha-1’ would work to upload the file.
Are you saying we need to downgrade to 4.0.0-alpha-1?
Just to understand the issue better, is Device Farm using any intermediate server or are the tests proxied directly to the ChromeDriver?
Hi Joe,
Have you find the solution or workaround for this issue: "org.openqa.selenium.UnsupportedCommandException: unknown command: unknown command: session/d9da4fe5dd9a7f504ba9b00cbadb182a/se/file"?
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Thank you for the information.
It's really sad that aws team doesn't care such basic and important feature.