'parses the string based desired_capabilities if neccessary and
creates the associated remote web driver'

def _create_remote_web_driver(self, capabilities_type, remote_url, desired_capabilities=None, profile=None):

    desired_capabilities_object = capabilities_type.copy()
    if (not isinstance(desired_capabilities, dict)):
        desired_capabilities = self._parse_capabilities_string(desired_capabilities)
    desired_capabilities_object.update((desired_capabilities or {}))
    return webdriver.Remote(desired_capabilities=desired_capabilities_object, command_executor=str(remote_url), browser_profile=profile)
