Skip to content

Commit 1c81be9

Browse files
Merge branch 'trunk' into cookie-jar
2 parents 74701ce + f697509 commit 1c81be9

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

java/private/export.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@contrib_rules_jvm//java:defs.bzl", "java_library")
12
load(
23
"@rules_jvm_external//:defs.bzl",
34
"javadoc",
@@ -24,7 +25,7 @@ def java_export(
2425
lib_name = "%s-lib" % name
2526

2627
# Construct the java_library we'll export from here.
27-
native.java_library(
28+
java_library(
2829
name = lib_name,
2930
tags = tags,
3031
exports = exports,

java/spotbugs-excludes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242

243243
<Match>
244244
<Class name="org.openqa.selenium.manager.SeleniumManager"/>
245-
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
245+
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE,IS2_INCONSISTENT_SYNC"/>
246246
</Match>
247247

248248
</FindBugsFilter>

py/selenium/webdriver/chromium/webdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def execute_cdp_cmd(self, cmd: str, cmd_args: dict):
138138
For example to getResponseBody:
139139
{'base64Encoded': False, 'body': 'response body string'}
140140
"""
141-
return self.execute("executeCdpCommand", {"cmd": cmd, "params": cmd_args})["value"]
141+
return super().execute_cdp_cmd(cmd, cmd_args)
142142

143143
def get_sinks(self) -> list:
144144
""":Returns: A list of sinks available for Cast."""

py/selenium/webdriver/remote/webdriver.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)