code: function resolveCapabilities(capabilities, capabilitiesDictionary) {
      if (typeof capabilities !== "string") {
          // we do not know how to parse non string capabilities, let's assume it
          // is selenium compliant capabilities and return it.
          return capabilities;
      }
  
      // try to parse as a JSON string
      try {
          return JSON.parse(capabilities);
      } catch (e) { }
  
  
      // No luck with JSON assumption.
      // Try to read from configuration.
      if (capabilities in capabilitiesDictionary) {
          return capabilitiesDictionary[capabilities];
      }
  
      // still no luck ?
      // assume this is browserName...
      return { browserName: capabilities };
  }
docs: Actual resolution for capabilities.