File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
py/selenium/webdriver/remote Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,26 @@ def _unwrap_value(self, value):
361361 return list (self ._unwrap_value (item ) for item in value )
362362 return value
363363
364+ def execute_cdp_cmd (self , cmd : str , cmd_args : dict ):
365+ """Execute Chrome Devtools Protocol command and get returned result The
366+ command and command args should follow chrome devtools protocol
367+ domains/commands, refer to link
368+ https://chromedevtools.github.io/devtools-protocol/
369+
370+ :Args:
371+ - cmd: A str, command name
372+ - cmd_args: A dict, command args. empty dict {} if there is no command args
373+ :Usage:
374+ ::
375+
376+ driver.execute_cdp_cmd('Network.getResponseBody', {'requestId': requestId})
377+ :Returns:
378+ A dict, empty dict {} if there is no result to return.
379+ For example to getResponseBody:
380+ {'base64Encoded': False, 'body': 'response body string'}
381+ """
382+ return self .execute ("executeCdpCommand" , {"cmd" : cmd , "params" : cmd_args })["value" ]
383+
364384 def execute (self , driver_command : str , params : dict = None ) -> dict :
365385 """Sends a command to be executed by a command.CommandExecutor.
366386
You can’t perform that action at this time.
0 commit comments