From 52845c30e7f514eb6c30a0718a6bacd9c60a0ba0 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Tue, 31 May 2022 10:02:39 +0200 Subject: [PATCH] [java] Adding LOGGING_PREFS to Edge and Chrome options With that, users can switch to that cap instead of using the deprecated one. --- java/src/org/openqa/selenium/chrome/ChromeOptions.java | 1 + java/src/org/openqa/selenium/edge/EdgeOptions.java | 7 ++++--- java/src/org/openqa/selenium/remote/CapabilityType.java | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/java/src/org/openqa/selenium/chrome/ChromeOptions.java b/java/src/org/openqa/selenium/chrome/ChromeOptions.java index 90e66962d74af..730d28ae856b7 100644 --- a/java/src/org/openqa/selenium/chrome/ChromeOptions.java +++ b/java/src/org/openqa/selenium/chrome/ChromeOptions.java @@ -51,6 +51,7 @@ public class ChromeOptions extends ChromiumOptions { * object. */ public static final String CAPABILITY = "goog:chromeOptions"; + public static final String LOGGING_PREFS = "goog:loggingPrefs"; private ChromeDriverLogLevel logLevel; public ChromeOptions() { diff --git a/java/src/org/openqa/selenium/edge/EdgeOptions.java b/java/src/org/openqa/selenium/edge/EdgeOptions.java index aa6732ca16e85..ac1d287fdc73d 100644 --- a/java/src/org/openqa/selenium/edge/EdgeOptions.java +++ b/java/src/org/openqa/selenium/edge/EdgeOptions.java @@ -16,12 +16,12 @@ // under the License. package org.openqa.selenium.edge; -import static org.openqa.selenium.remote.Browser.EDGE; - import org.openqa.selenium.Capabilities; import org.openqa.selenium.chromium.ChromiumOptions; import org.openqa.selenium.remote.CapabilityType; +import static org.openqa.selenium.remote.Browser.EDGE; + /** * Class to manage options specific to {@link EdgeDriver}. * @@ -44,10 +44,11 @@ public class EdgeOptions extends ChromiumOptions { /** - * Key used to store a set of ChromeOptions in a {@link Capabilities} + * Key used to store a set of EdgeOptions in a {@link Capabilities} * object. */ public static final String CAPABILITY = "ms:edgeOptions"; + public static final String LOGGING_PREFS = "ms:loggingPrefs"; public EdgeOptions() { super(CapabilityType.BROWSER_NAME, EDGE.browserName(), CAPABILITY); diff --git a/java/src/org/openqa/selenium/remote/CapabilityType.java b/java/src/org/openqa/selenium/remote/CapabilityType.java index d169cd7e3eedc..f17524111d67d 100644 --- a/java/src/org/openqa/selenium/remote/CapabilityType.java +++ b/java/src/org/openqa/selenium/remote/CapabilityType.java @@ -115,6 +115,8 @@ public interface CapabilityType { /** * @deprecated Non W3C compliant + * Use {@link org.openqa.selenium.chrome.ChromeOptions#LOGGING_PREFS} or + * Use {@link org.openqa.selenium.edge.EdgeOptions#LOGGING_PREFS} */ @Deprecated String LOGGING_PREFS = "loggingPrefs";