Skip to content

Commit

Permalink
[java] do not enable CDP deprecation warning if BiDi enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Delta456 committed Jan 27, 2025
1 parent 54ead9d commit b9a0232
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions java/src/org/openqa/selenium/devtools/CdpEndpointFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ public static Optional<URI> getReportedUri(Capabilities caps) {
break;
case "firefox":
key = "moz:debuggerAddress";
LOG.warning(
"CDP support for Firefox is deprecated and will be removed in future versions. "
+ "Please switch to WebDriver BiDi.");
if (!(Boolean) caps.getCapability("webSocketUrl")) {
LOG.warning(
"CDP support for Firefox is deprecated and will be removed in future versions. "
+ "Please switch to WebDriver BiDi.");
}
break;
default:
return Optional.empty();
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/firefox/FirefoxDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private FirefoxDriver(
Optional<URI> reportedUri =
CdpEndpointFinder.getReportedUri("moz:debuggerAddress", capabilities);

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

0 comments on commit b9a0232

Please sign in to comment.