From d3096258205a12922b12e85638ca39474d00ac79 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 3 Aug 2025 00:26:14 +0300 Subject: [PATCH 1/2] [dotnet] Remove long awaited obsolete members --- .../src/webdriver/Chromium/ChromiumDriver.cs | 13 --------- .../Chromium/ChromiumDriverService.cs | 11 -------- .../src/webdriver/DevTools/DevToolsSession.cs | 7 ----- dotnet/src/webdriver/DevTools/IDevTools.cs | 20 ------------- .../src/webdriver/Edge/EdgeDriverService.cs | 10 ------- .../src/webdriver/Firefox/FirefoxOptions.cs | 10 ------- .../webdriver/Interactions/ActionSequence.cs | 7 ----- .../Internal/Logging/ConsoleLogHandler.cs | 28 ------------------- .../src/webdriver/Remote/RemoteWebDriver.cs | 13 --------- dotnet/src/webdriver/UserAgent.cs | 9 ------ 10 files changed, 128 deletions(-) delete mode 100644 dotnet/src/webdriver/Internal/Logging/ConsoleLogHandler.cs diff --git a/dotnet/src/webdriver/Chromium/ChromiumDriver.cs b/dotnet/src/webdriver/Chromium/ChromiumDriver.cs index a53c848c851fb..ac9b73c04d899 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumDriver.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumDriver.cs @@ -345,19 +345,6 @@ public DevToolsSession GetDevToolsSession(DevToolsOptions options) return this.devToolsSession; } - /// - /// Creates a session to communicate with a browser using the Chromium Developer Tools debugging protocol. - /// - /// The version of the Chromium Developer Tools protocol to use. Defaults to autodetect the protocol version. - /// The active session to use to communicate with the Chromium Developer Tools debugging protocol. - [Obsolete("Use GetDevToolsSession(DevToolsOptions options)")] - [RequiresUnreferencedCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - public DevToolsSession GetDevToolsSession(int devToolsProtocolVersion) - { - return GetDevToolsSession(new DevToolsOptions() { ProtocolVersion = devToolsProtocolVersion }); - } - /// /// Closes a DevTools session. /// diff --git a/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs b/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs index 44c9f4d41bee9..53e25359dbdd2 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs @@ -89,17 +89,6 @@ protected ChromiumDriverService(string? executablePath, string? executableFileNa /// public ChromiumDriverLogLevel LogLevel { get; set; } = ChromiumDriverLogLevel.Default; - /// - /// Gets or sets the comma-delimited list of IP addresses that are approved to connect to this instance of the Chrome driver. - /// A value of or means only the local loopback address can connect. - /// - [Obsolete($"Use {nameof(AllowedIPAddresses)}")] - public string? WhitelistedIPAddresses - { - get => this.AllowedIPAddresses; - set => this.AllowedIPAddresses = value; - } - /// /// Gets or sets the comma-delimited list of IP addresses that are approved to connect to this instance of the Chrome driver. /// A value of or means only the local loopback address can connect. diff --git a/dotnet/src/webdriver/DevTools/DevToolsSession.cs b/dotnet/src/webdriver/DevTools/DevToolsSession.cs index 7ceff5c45e5f5..1f3b3e31b1d6b 100644 --- a/dotnet/src/webdriver/DevTools/DevToolsSession.cs +++ b/dotnet/src/webdriver/DevTools/DevToolsSession.cs @@ -62,13 +62,6 @@ public class DevToolsSession : IDevToolsSession private readonly static ILogger logger = Internal.Logging.Log.GetLogger(); - /// - /// Initializes a new instance of the DevToolsSession class, using the specified WebSocket endpoint. - /// - /// - [Obsolete("Use DevToolsSession(string endpointAddress, DevToolsOptions options)")] - public DevToolsSession(string endpointAddress) : this(endpointAddress, new DevToolsOptions()) { } - /// /// Initializes a new instance of the DevToolsSession class, using the specified WebSocket endpoint and specified DevTools options. /// diff --git a/dotnet/src/webdriver/DevTools/IDevTools.cs b/dotnet/src/webdriver/DevTools/IDevTools.cs index 7652e2ca71b1b..93b3622b91714 100644 --- a/dotnet/src/webdriver/DevTools/IDevTools.cs +++ b/dotnet/src/webdriver/DevTools/IDevTools.cs @@ -40,26 +40,6 @@ public interface IDevTools [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] DevToolsSession GetDevToolsSession(); - /// - /// Creates a session to communicate with a browser using a specific version of the Developer Tools debugging protocol. - /// - /// The options for the DevToolsSession to use. - /// The active session to use to communicate with the Developer Tools debugging protocol. - /// If is . - [RequiresUnreferencedCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - DevToolsSession GetDevToolsSession(DevToolsOptions options); - - /// - /// Creates a session to communicate with a browser using a specific version of the Developer Tools debugging protocol. - /// - /// The specific version of the Developer Tools debugging protocol to use. - /// The active session to use to communicate with the Developer Tools debugging protocol. - [Obsolete("Use GetDevToolsSession(DevToolsOptions options)")] - [RequiresUnreferencedCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - DevToolsSession GetDevToolsSession(int protocolVersion); - /// /// Closes a DevTools session /// diff --git a/dotnet/src/webdriver/Edge/EdgeDriverService.cs b/dotnet/src/webdriver/Edge/EdgeDriverService.cs index 6da2741069290..1619d8b499239 100644 --- a/dotnet/src/webdriver/Edge/EdgeDriverService.cs +++ b/dotnet/src/webdriver/Edge/EdgeDriverService.cs @@ -48,16 +48,6 @@ protected override DriverOptions GetDefaultDriverOptions() return new EdgeOptions(); } - /// - /// Gets or sets a value indicating whether the service should use verbose logging. - /// - [Obsolete("Use EnableVerboseLogging")] - public bool UseVerboseLogging - { - get => this.EnableVerboseLogging; - set => this.EnableVerboseLogging = value; - } - /// /// Creates a default instance of the EdgeDriverService. /// diff --git a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs index 25ae10039fba8..143e154e9638a 100644 --- a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs +++ b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs @@ -98,16 +98,6 @@ public FirefoxOptions() /// public override string? BinaryLocation { get; set; } - /// - /// Gets or sets the path and file name of the Firefox browser executable. - /// - [Obsolete("Use BinaryLocation property instead of BrowserExecutableLocation. This one will be removed soon.")] - public string? BrowserExecutableLocation - { - get => this.BinaryLocation; - set => this.BinaryLocation = value; - } - /// /// Gets or sets the logging level of the Firefox driver. /// diff --git a/dotnet/src/webdriver/Interactions/ActionSequence.cs b/dotnet/src/webdriver/Interactions/ActionSequence.cs index 564c1329d9e38..7e76007865520 100644 --- a/dotnet/src/webdriver/Interactions/ActionSequence.cs +++ b/dotnet/src/webdriver/Interactions/ActionSequence.cs @@ -60,13 +60,6 @@ public ActionSequence(InputDevice device, int initialSize) /// public int Count => this.interactions.Count; - /// - /// Gets the input device for this Action sequence. - /// - [Obsolete("This property has been renamed to InputDevice and will be removed in a future version")] - [CLSCompliant(false)] - public InputDevice inputDevice => InputDevice; - /// /// Gets the input device for this Action sequence. /// diff --git a/dotnet/src/webdriver/Internal/Logging/ConsoleLogHandler.cs b/dotnet/src/webdriver/Internal/Logging/ConsoleLogHandler.cs deleted file mode 100644 index d40653de2fbfe..0000000000000 --- a/dotnet/src/webdriver/Internal/Logging/ConsoleLogHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -// -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -using System; - -namespace OpenQA.Selenium.Internal.Logging; - -/// -/// Represents a log handler that writes log events to the given text writer. -/// -[Obsolete("Use TextWriterHandler instead, will be removed in v4.32")] -public class ConsoleLogHandler() : TextWriterHandler(Console.Error); diff --git a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs index e7cdf4216ca25..a71f985af1aa7 100644 --- a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs +++ b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs @@ -496,19 +496,6 @@ public DevToolsSession GetDevToolsSession(DevToolsOptions options) return this.devToolsSession; } - /// - /// Creates a session to communicate with a browser using a specific version of the Developer Tools debugging protocol. - /// - /// The specific version of the Developer Tools debugging protocol to use. - /// The active session to use to communicate with the Developer Tools debugging protocol. - [Obsolete("Use GetDevToolsSession(DevToolsOptions options)")] - [RequiresUnreferencedCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] - public DevToolsSession GetDevToolsSession(int protocolVersion) - { - return GetDevToolsSession(new DevToolsOptions() { ProtocolVersion = protocolVersion }); - } - /// /// Retrieves the downloadable files. /// diff --git a/dotnet/src/webdriver/UserAgent.cs b/dotnet/src/webdriver/UserAgent.cs index 223129a7a526a..892a3a6b01815 100644 --- a/dotnet/src/webdriver/UserAgent.cs +++ b/dotnet/src/webdriver/UserAgent.cs @@ -26,15 +26,6 @@ namespace OpenQA.Selenium.DevTools; /// public class UserAgent { - /// - /// Initializes a new instance of the type. - /// - [Obsolete("Use the constructor which sets the userAgentString")] - public UserAgent() - { - UserAgentString = null!; - } - /// /// Initializes a new instance of the type. /// From 50a4ecf311be2e98a421612996080ab9b5bf0d43 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 3 Aug 2025 00:40:21 +0300 Subject: [PATCH 2/2] Return back interface method --- dotnet/src/webdriver/DevTools/IDevTools.cs | 10 ++++++++++ dotnet/src/webdriver/UserAgent.cs | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dotnet/src/webdriver/DevTools/IDevTools.cs b/dotnet/src/webdriver/DevTools/IDevTools.cs index 93b3622b91714..12441e6428cc6 100644 --- a/dotnet/src/webdriver/DevTools/IDevTools.cs +++ b/dotnet/src/webdriver/DevTools/IDevTools.cs @@ -40,6 +40,16 @@ public interface IDevTools [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] DevToolsSession GetDevToolsSession(); + /// + /// Creates a session to communicate with a browser using a specific version of the Developer Tools debugging protocol. + /// + /// The options for the DevToolsSession to use. + /// The active session to use to communicate with the Developer Tools debugging protocol. + /// If is . + [RequiresUnreferencedCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] + [RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)] + DevToolsSession GetDevToolsSession(DevToolsOptions options); + /// /// Closes a DevTools session /// diff --git a/dotnet/src/webdriver/UserAgent.cs b/dotnet/src/webdriver/UserAgent.cs index 892a3a6b01815..7268ff16343ea 100644 --- a/dotnet/src/webdriver/UserAgent.cs +++ b/dotnet/src/webdriver/UserAgent.cs @@ -17,8 +17,6 @@ // under the License. // -using System; - namespace OpenQA.Selenium.DevTools; ///