Use an InMemorySession for legacy FirefoxDriver
The profile to use has been extracted to the XpiDriverService,
so if we use that and a ServicedSession, it becomes impossible
to pass the profile to the driver. This is a sub-optimal way
to make things work.
@@ -71,12 +71,17 @@ public ActiveSessionFactory() {
StreamSupport.stream(loadDriverProviders().spliterator(), false)
.forEach(p -> builder.put(p::canCreateDriverInstanceFor, new InMemorySession.Factory(p)));
- ImmutableMap.<Predicate<Capabilities>, String>builder()
- .put(caps -> {
+ bind(
+ builder,
+ "org.openqa.selenium.firefox.FirefoxDriver",
+ caps -> {
Object marionette = caps.getCapability("marionette");
return marionette instanceof Boolean && !(Boolean) marionette;
- }, "org.openqa.selenium.firefox.XpiDriverService")
+ },
+ firefox());
+
+ ImmutableMap.<Predicate<Capabilities>, String>builder()
.put(browserName(chrome()), "org.openqa.selenium.chrome.ChromeDriverService")
.put(containsKey("chromeOptions"), "org.openqa.selenium.chrome.ChromeDriverService")
.put(browserName(edge()), "org.openqa.selenium.edge.EdgeDriverService")
