diff --git a/dotnet/src/webdriver/Chromium/ChromiumOptions.cs b/dotnet/src/webdriver/Chromium/ChromiumOptions.cs index 0a126884bec6c..9c568fc5a811b 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumOptions.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumOptions.cs @@ -190,10 +190,20 @@ public ChromiumAndroidOptions AndroidOptions /// should use the legacy OSS protocol dialect or a dialect compliant with the W3C /// WebDriver Specification. /// + [Obsolete("Spec Compliant Protocol is the only supported protocol")] public bool UseSpecCompliantProtocol { get { return this.useSpecCompliantProtocol; } - set { this.useSpecCompliantProtocol = value; } + set + { + if (!value) + { + throw new ArgumentException("Only the spec compliant protocol is supported, " + + "Please update to W3C Syntax: " + + "https://www.selenium.dev/blog/2022/legacy-protocol-support/"); + } + this.useSpecCompliantProtocol = true; + } } /// diff --git a/dotnet/test/chrome/ChromeSpecificTests.cs b/dotnet/test/chrome/ChromeSpecificTests.cs index 063f9fc4ba90b..f19cbb5aa9cfd 100644 --- a/dotnet/test/chrome/ChromeSpecificTests.cs +++ b/dotnet/test/chrome/ChromeSpecificTests.cs @@ -1,9 +1,26 @@ -using NUnit.Framework; +using System; +using NUnit.Framework; +using OpenQA.Selenium.Environment; namespace OpenQA.Selenium.Chrome { [TestFixture] public class ChromeSpecificTests : DriverTestFixture { + [OneTimeTearDown] + public void RunAfterAnyTests() + { + EnvironmentManager.Instance.CloseCurrentDriver(); + EnvironmentManager.Instance.WebServer.Stop(); + } + + [Test] + public void W3CFalse() + { + Assert.Throws(() => new ChromeOptions + { + UseSpecCompliantProtocol = false + }); + } } }