Skip to content

Commit

Permalink
add possibility to upload file on selenoid (chrome) (#115)
Browse files Browse the repository at this point in the history
added possibility to use local file system to load files on remote
  • Loading branch information
iFreezy authored and GannaChernyshova committed Nov 22, 2018
1 parent 471d7d1 commit 9e28230
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.openqa.selenium.opera.OperaOptions;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.LocalFileDetector;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.safari.SafariDriver;
import org.openqa.selenium.safari.SafariOptions;
Expand Down Expand Up @@ -132,10 +133,12 @@ private WebDriver getRemoteDriver(MutableCapabilities capabilities, String remot
capabilities.setCapability("screenResolution", String.format("%sx%s", loadSystemPropertyOrDefault(WINDOW_WIDTH, DEFAULT_WIDTH),
loadSystemPropertyOrDefault(WINDOW_HEIGHT, DEFAULT_HEIGHT)));
try {
return new RemoteWebDriver(
URI.create(remoteUrl).toURL(),
capabilities
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(
URI.create(remoteUrl).toURL(),
capabilities
);
remoteWebDriver.setFileDetector(new LocalFileDetector());
return remoteWebDriver;
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 9e28230

Please sign in to comment.