Skip to content

Commit 9e28230

Browse files
iFreezyGannaChernyshova
authored andcommitted
add possibility to upload file on selenoid (chrome) (#115)
added possibility to use local file system to load files on remote
1 parent 471d7d1 commit 9e28230

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/ru/alfabank/tests/core/drivers/CustomDriverProvider.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.openqa.selenium.opera.OperaOptions;
3636
import org.openqa.selenium.remote.CapabilityType;
3737
import org.openqa.selenium.remote.DesiredCapabilities;
38+
import org.openqa.selenium.remote.LocalFileDetector;
3839
import org.openqa.selenium.remote.RemoteWebDriver;
3940
import org.openqa.selenium.safari.SafariDriver;
4041
import org.openqa.selenium.safari.SafariOptions;
@@ -132,10 +133,12 @@ private WebDriver getRemoteDriver(MutableCapabilities capabilities, String remot
132133
capabilities.setCapability("screenResolution", String.format("%sx%s", loadSystemPropertyOrDefault(WINDOW_WIDTH, DEFAULT_WIDTH),
133134
loadSystemPropertyOrDefault(WINDOW_HEIGHT, DEFAULT_HEIGHT)));
134135
try {
135-
return new RemoteWebDriver(
136-
URI.create(remoteUrl).toURL(),
137-
capabilities
136+
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(
137+
URI.create(remoteUrl).toURL(),
138+
capabilities
138139
);
140+
remoteWebDriver.setFileDetector(new LocalFileDetector());
141+
return remoteWebDriver;
139142
} catch (MalformedURLException e) {
140143
throw new RuntimeException(e);
141144
}

0 commit comments

Comments
 (0)