@@ -72,8 +72,10 @@ public class ChromeOptions : DriverOptions
7272 private const string MobileEmulationChromeOption = "mobileEmulation" ;
7373 private const string PerformanceLoggingPreferencesChromeOption = "perfLoggingPrefs" ;
7474 private const string WindowTypesChromeOption = "windowTypes" ;
75+ private const string UseSpecCompliantProtocolOption = "w3c" ;
7576
7677 private bool leaveBrowserRunning ;
78+ private bool useSpecCompliantProtocol ;
7779 private string binaryLocation ;
7880 private string debuggerAddress ;
7981 private string minidumpPath ;
@@ -108,6 +110,7 @@ public ChromeOptions() : base()
108110 this . AddKnownCapabilityName ( ChromeOptions . MobileEmulationChromeOption , "EnableMobileEmulation method" ) ;
109111 this . AddKnownCapabilityName ( ChromeOptions . PerformanceLoggingPreferencesChromeOption , "PerformanceLoggingPreferences property" ) ;
110112 this . AddKnownCapabilityName ( ChromeOptions . WindowTypesChromeOption , "AddWindowTypes method" ) ;
113+ this . AddKnownCapabilityName ( ChromeOptions . UseSpecCompliantProtocolOption , "UseSpecCompliantProtocol property" ) ;
111114 }
112115
113116 /// <summary>
@@ -184,6 +187,17 @@ public ChromePerformanceLoggingPreferences PerformanceLoggingPreferences
184187 set { this . perfLoggingPreferences = value ; }
185188 }
186189
190+ /// <summary>
191+ /// Gets or sets a value indicating whether the <see cref="ChromeDriver"/> instance
192+ /// should use the legacy OSS protocol dialect or a dialect compliant with the W3C
193+ /// WebDriver Specification.
194+ /// </summary>
195+ public bool UseSpecCompliantProtocol
196+ {
197+ get { return this . useSpecCompliantProtocol ; }
198+ set { this . useSpecCompliantProtocol = value ; }
199+ }
200+
187201 /// <summary>
188202 /// Adds a single argument to the list of arguments to be appended to the Chrome.exe command line.
189203 /// </summary>
@@ -596,6 +610,11 @@ private Dictionary<string, object> BuildChromeOptionsDictionary()
596610 chromeOptions [ DetachChromeOption ] = this . leaveBrowserRunning ;
597611 }
598612
613+ if ( this . useSpecCompliantProtocol )
614+ {
615+ chromeOptions [ UseSpecCompliantProtocolOption ] = this . useSpecCompliantProtocol ;
616+ }
617+
599618 if ( ! string . IsNullOrEmpty ( this . debuggerAddress ) )
600619 {
601620 chromeOptions [ DebuggerAddressChromeOption ] = this . debuggerAddress ;
0 commit comments