Reputation: 1868
The method is worked fine when I run tests locally, but when tests are run with a Selenium grid or Zalenium the multiple upload method not works.
String path = "a.jpg";
String path1 = "b.jpg";
String path2 = "c.jpg";
element.sendKeys(path + "\n " + path1 + "\n " + path2);
Did anyone solve this issue?
Upvotes: 0
Views: 292
Reputation: 1
I had the exact same problem. The multiple files method worked fine locally but it failed with Selenium Grid.
In my case, the problem was that I concatenated with " \n "
, that worked locally but remote didn't.
element.sendKeys(path + " \n " + path1 + " \n " + path2);
I see that your case is similar because you concatenated with a blank space after "\n "
.
You need to add de newline without blank space "\n"
element.sendKeys(path + "\n" + path1 + "\n" + path2);
Upvotes: 0
Reputation: 11
For handling files in remote driver you need to set FileDetector. Below is the code to set the file Detector.
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(new URL(hubUrl), getDesiredCapabilties(Browser.REMOTE_WEBDRIVER));
remoteWebDriver.setFileDetector(new LocalFileDetector());
Upvotes: 0