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

Method execute_cdp_cmd

py/selenium/webdriver/remote/webdriver.py:444–464  ·  view source on GitHub ↗

Execute Chrome Devtools Protocol command and get returned result. The command and command args should follow chrome devtools protocol domains/commands: - https://chromedevtools.github.io/devtools-protocol/ Args: cmd: Command name. cmd_args: Command

(self, cmd: str, cmd_args: dict)

Source from the content-addressed store, hash-verified

442 return value
443
444 def execute_cdp_cmd(self, cmd: str, cmd_args: dict):
445 """Execute Chrome Devtools Protocol command and get returned result.
446
447 The command and command args should follow chrome devtools protocol domains/commands:
448 - https://chromedevtools.github.io/devtools-protocol/
449
450 Args:
451 cmd: Command name.
452 cmd_args: Command args. Empty dict {} if there is no command args.
453
454 Returns:
455 A dict, empty dict {} if there is no result to return. To
456 getResponseBody: {'base64Encoded': False, 'body': 'response body
457 string'}
458
459 Example:
460 `driver.execute_cdp_cmd("Network.getResponseBody", {"requestId": requestId})`
461 """
462 if self.caps["browserName"].lower() == "firefox":
463 raise RuntimeError("CDP support for Firefox has been removed. Please switch to WebDriver BiDi.")
464 return self.execute("executeCdpCommand", {"cmd": cmd, "params": cmd_args})["value"]
465
466 def execute(
467 self,

Callers

nothing calls this directly

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected