Get driver capabilities from Browser in test
package org.openqa.selenium.remote.server;
-import static org.junit.Assert.assertTrue;
-import static org.openqa.selenium.json.Json.MAP_TYPE;
-import static org.openqa.selenium.remote.http.Contents.string;
-import static org.openqa.selenium.testing.drivers.Browser.CHROME;
-import static org.openqa.selenium.testing.drivers.Browser.EDGE;
-import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT;
-import static org.openqa.selenium.testing.drivers.Browser.IE;
-import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
-
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.drivers.Browser;
import org.openqa.selenium.testing.drivers.OutOfProcessSeleniumServer;
-import org.openqa.selenium.testing.drivers.WebDriverBuilder;
import java.io.IOException;
import java.net.URL;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
+import static org.junit.Assert.assertTrue;
+import static org.openqa.selenium.json.Json.MAP_TYPE;
+import static org.openqa.selenium.remote.http.Contents.string;
+import static org.openqa.selenium.testing.drivers.Browser.CHROME;
+import static org.openqa.selenium.testing.drivers.Browser.EDGE;
+import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT;
+import static org.openqa.selenium.testing.drivers.Browser.IE;
+import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
+
@Ignore(HTMLUNIT)
@Ignore(IE)
@Ignore(CHROME)
@@ -82,7 +82,7 @@ public void stopDriver() {
}
private void startDriver() {
- Capabilities caps = WebDriverBuilder.getStandardCapabilitiesFor(Browser.detect());
+ Capabilities caps = Objects.requireNonNull(Browser.detect()).getCapabilities();
localDriver = new RemoteWebDriver(server.getWebDriverUrl(), caps);
localDriver.setFileDetector(new LocalFileDetector());
}
