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]: Unable to upload file to a Mac Safari node when using selenium Grid. #14620

Open
vvbisht opened this issue Oct 18, 2024 · 1 comment

Comments

@vvbisht
Copy link

vvbisht commented Oct 18, 2024

What happened?

Selenium version : 4.24.0
Java : 11
Platform : MAC Sonoma 14.0
Browser : Safari v 17

I have setup a Selenium Grid with a MAC hub and multiple mac nodes. When i am trying to perform a file upload operation through grid it's failing and throwing following exception.
org.openqa.selenium.InvalidArgumentException: An invalid command argument was specified: One or more files could not be selected.

Please note that on running the test without grid this seems to be working fine. I have tried changing the path with "/" and "\" but nothing seems to be working.

How can we reproduce the issue?

String hub = "http://*.*.*.*:4444/wd/hub";
            SafariOptions options = new SafariOptions();
            options.setCapability("browserName", "safari");
            options.setCapability("platformName", "mac");
            WebDriver driver = null;
            //driver = new RemoteWebDriver(new URL(hub), options);
            RemoteWebDriver driver = new RemoteWebDriver(new URL(hub), options);
            driver.setFileDetector(new LocalFileDetector());
        String filePath = "C:/sample.txt";
        driver.get("https://the-internet.herokuapp.com/upload");
        WebElement element = driver1.findElement(By.id("file-upload"));
        element.sendKeys(filePath);


### Relevant log output

```shell
org.openqa.selenium.InvalidArgumentException: An invalid command argument was specified: One or more files could not be selected.
Build info: version: '4.24.0', revision: '748ffc9bc3'
System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.23'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [BB0D158E-6371-4143-A373-9A3E5296337F, sendKeysToElement {value=[Ljava.lang.CharSequence;@2bd08376, id=node-D15E858C-69C7-4467-8D03-373A0981CD24}]
Capabilities {acceptInsecureCerts: false, browserName: Safari, browserVersion: 17.0, platformName: mac, safari:automaticInspection: false, safari:automaticProfiling: false, safari:diagnose: false, safari:platformBuildVersion: 23A344, safari:platformVersion: 14.0, safari:useSimulator: false, se:bidiEnabled: false, se:cdpEnabled: false, setWindowRect: true, strictFileInteractability: false, webkit:WebRTC: {DisableICECandidateFiltering: false, DisableInsecureMediaCapture: false}}
Element: [[RemoteWebDriver: Safari on mac (BB0D158E-6371-4143-A373-9A3E5296337F)] -> id: file-upload]
Session ID: BB0D158E-6371-4143-A373-9A3E5296337F
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190)
	at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:53)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
	at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:223)
	at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:110)

Operating System

macOS

Selenium version

4.24.0

What are the browser(s) and version(s) where you see this issue?

Safari

What are the browser driver(s) and version(s) where you see this issue?

Safari 17

Are you using Selenium Grid?

4.24.0

Copy link

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

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

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

Thank you!

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

1 participant