Closed Erli96 closed 2 months ago
What's the file
variable? how it is defined? is it a File class? or is it somehting you have developed?
or better, can you get the string returned by file.getAbsolutePath()
and check that it is an actual string? and can you post it here, if you can, or try to reproduce the issue with a similar string.
Thanks
Well file
variable is an object of File
class.
File file = new File(Path.of("A", "B", "C", "D","example").toString());
A String path is passed as argument to File
constructor and actually it is a real String, I checked it.
And also the tests are running fine when running locally.
But we are getting this UnsupportedCommandException
on 2.0.0
version only when running the tests using a remote Selenium server, not on another occasion. When using the old version it was fine on both the remote Selenium server and locally.
cant reproduce it, I have tried with the following code:
ChromeOptions options = new ChromeOptions();
Configuration.softAsserts = false;
Configuration.remote = "http://localhost:4444/wd/hub/";
options.addArguments("--user-agent=Agent", "headless");
Configuration.chromeOptions = options;
selenideBrowserCapabilities.setBrowserName("chrome");
open("https://www.whatsmyua.info/");
E(byCssSelector("textarea")).waitFor(10).untilHasText("Agent");
File file = new File("pom.xml");
E(byCssSelector("textarea")).sendKeys(file.getAbsolutePath());
It works as expected. Please if you use any example, dont put external libraries, or tell me which are those, `Path.of` is not included in my Java distribution.
closing it since there is no response, Ill reopen if something new comes up
When trying to send a String file path to an
UIElement
as in this code section:an Exception is thrown: