MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / _create_caps

Function _create_caps

py/selenium/webdriver/remote/webdriver.py:148–164  ·  view source on GitHub ↗

Makes a W3C alwaysMatch capabilities object. Filters out capability names that are not in the W3C spec. Spec-compliant drivers will reject requests containing unknown capability names. Moves the Firefox profile, if present, from the old location to the new Firefox options object.

(caps)

Source from the content-addressed store, hash-verified

146
147
148def _create_caps(caps) -> dict:
149 """Makes a W3C alwaysMatch capabilities object.
150
151 Filters out capability names that are not in the W3C spec. Spec-compliant
152 drivers will reject requests containing unknown capability names.
153
154 Moves the Firefox profile, if present, from the old location to the new Firefox
155 options object.
156
157 Args:
158 caps: A dictionary of capabilities requested by the caller.
159 """
160 caps = copy.deepcopy(caps)
161 always_match = {}
162 for k, v in caps.items():
163 always_match[k] = v
164 return {"capabilities": {"firstMatch": [{}], "alwaysMatch": always_match}}
165
166
167def get_remote_connection(

Callers 1

start_sessionMethod · 0.85

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected