Skip to content

Commit b9a0232

Browse files
committed
[java] do not enable CDP deprecation warning if BiDi enabled
1 parent 54ead9d commit b9a0232

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

java/src/org/openqa/selenium/devtools/CdpEndpointFinder.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ public static Optional<URI> getReportedUri(Capabilities caps) {
9191
break;
9292
case "firefox":
9393
key = "moz:debuggerAddress";
94-
LOG.warning(
95-
"CDP support for Firefox is deprecated and will be removed in future versions. "
96-
+ "Please switch to WebDriver BiDi.");
94+
if (!(Boolean) caps.getCapability("webSocketUrl")) {
95+
LOG.warning(
96+
"CDP support for Firefox is deprecated and will be removed in future versions. "
97+
+ "Please switch to WebDriver BiDi.");
98+
}
9799
break;
98100
default:
99101
return Optional.empty();

java/src/org/openqa/selenium/firefox/FirefoxDriver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private FirefoxDriver(
165165
Optional<URI> reportedUri =
166166
CdpEndpointFinder.getReportedUri("moz:debuggerAddress", capabilities);
167167

168-
if (reportedUri.isPresent()) {
168+
if (reportedUri.isPresent() && !(Boolean) capabilities.getCapability("webSocketUrl")) {
169169
LOG.warning(
170170
"CDP support for Firefox is deprecated and will be removed in future versions. "
171171
+ "Please switch to WebDriver BiDi.");

0 commit comments

Comments
 (0)