Skip to content

Commit

Permalink
FirefoxOptions should add browser name to the generated capabilities.…
Browse files Browse the repository at this point in the history
… Otherwise new RemoteWebDriver(url, options.toCapabilities()) sends payload without browserName and grid hub can match it to a node that has no ability to run Firefox.
  • Loading branch information
barancev committed Sep 1, 2017
1 parent a7f9cb8 commit dadc09e
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -21,7 +21,9 @@
import static org.openqa.selenium.firefox.FirefoxDriver.BINARY;
import static org.openqa.selenium.firefox.FirefoxDriver.MARIONETTE;
import static org.openqa.selenium.firefox.FirefoxDriver.PROFILE;
import static org.openqa.selenium.remote.BrowserType.FIREFOX;
import static org.openqa.selenium.remote.CapabilityType.ACCEPT_SSL_CERTS;
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.LOGGING_PREFS;
import static org.openqa.selenium.remote.CapabilityType.PAGE_LOAD_STRATEGY;
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_WEB_STORAGE;
Expand All @@ -41,6 +43,7 @@
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.io.File;
Expand Down Expand Up @@ -478,6 +481,7 @@ private FirefoxProfile extractProfile(Capabilities capabilities) {

public Capabilities toCapabilities() {
HashMap<String, Object> caps = new HashMap<>(desiredCapabilities.asMap());
caps.put(BROWSER_NAME, FIREFOX);

if (isLegacy()) {
caps.put(FirefoxDriver.MARIONETTE, false);
Expand Down

0 comments on commit dadc09e

Please sign in to comment.