Skip to content

Commit b00c958

Browse files
authored
Use vendor-specific method names for additional Chromium options. (#9906)
1 parent fce8ce0 commit b00c958

File tree

3 files changed

+45
-5
lines changed

3 files changed

+45
-5
lines changed

dotnet/src/webdriver/Chrome/ChromeOptions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,25 @@ public override string CapabilityName
7979
{
8080
get { return string.Format(CultureInfo.InvariantCulture, "{0}:{1}", this.VendorPrefix, ChromeOptionsCapabilityName); }
8181
}
82+
83+
/// <summary>
84+
/// Provides a means to add additional capabilities not yet added as type safe options
85+
/// for the Chrome driver.
86+
/// </summary>
87+
/// <param name="optionName">The name of the capability to add.</param>
88+
/// <param name="optionValue">The value of the capability to add.</param>
89+
/// <exception cref="ArgumentException">
90+
/// thrown when attempting to add a capability for which there is already a type safe option, or
91+
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
92+
/// </exception>
93+
/// <remarks>Calling <see cref="AddAdditionalChromeOption(string, object)"/>
94+
/// where <paramref name="optionName"/> has already been added will overwrite the
95+
/// existing value with the new value in <paramref name="optionValue"/>.
96+
/// Calling this method adds capabilities to the Chrome-specific options object passed to
97+
/// webdriver executable (property name 'goog:chromeOptions').</remarks>
98+
public void AddAdditionalChromeOption(string optionName, object optionValue)
99+
{
100+
this.AddAdditionalChromiumOption(optionName, optionValue);
101+
}
82102
}
83103
}

dotnet/src/webdriver/Chromium/ChromiumOptions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,12 @@ public void AddWindowTypes(IEnumerable<string> windowTypesToAdd)
495495
/// thrown when attempting to add a capability for which there is already a type safe option, or
496496
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
497497
/// </exception>
498-
/// <remarks>Calling <see cref="AddAdditionalChromeOption(string, object)"/>
498+
/// <remarks>Calling <see cref="AddAdditionalChromiumOption(string, object)"/>
499499
/// where <paramref name="optionName"/> has already been added will overwrite the
500500
/// existing value with the new value in <paramref name="optionValue"/>.
501-
/// Calling this method adds capabilities to the Chrome-specific options object passed to
502-
/// webdriver executable (property name 'goog:chromeOptions').</remarks>
503-
public void AddAdditionalChromeOption(string optionName, object optionValue)
501+
/// Calling this method adds capabilities to the Chromium-specific options object passed to
502+
/// webdriver executable (e.g. property name 'goog:chromeOptions').</remarks>
503+
protected void AddAdditionalChromiumOption(string optionName, object optionValue)
504504
{
505505
this.ValidateCapabilityName(optionName);
506506
this.additionalChromeOptions[optionName] = optionValue;
@@ -554,7 +554,7 @@ public void AddAdditionalCapability(string capabilityName, object capabilityValu
554554
}
555555
else
556556
{
557-
this.AddAdditionalChromeOption(capabilityName, capabilityValue);
557+
this.AddAdditionalChromiumOption(capabilityName, capabilityValue);
558558
}
559559
}
560560

dotnet/src/webdriver/Edge/EdgeOptions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,25 @@ public bool UseWebView
8282
get { return this.BrowserName == WebViewBrowserNameValue; }
8383
set { this.BrowserName = value ? WebViewBrowserNameValue : DefaultBrowserNameValue; }
8484
}
85+
86+
/// <summary>
87+
/// Provides a means to add additional capabilities not yet added as type safe options
88+
/// for the Edge driver.
89+
/// </summary>
90+
/// <param name="optionName">The name of the capability to add.</param>
91+
/// <param name="optionValue">The value of the capability to add.</param>
92+
/// <exception cref="ArgumentException">
93+
/// thrown when attempting to add a capability for which there is already a type safe option, or
94+
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
95+
/// </exception>
96+
/// <remarks>Calling <see cref="AddAdditionalEdgeOption(string, object)"/>
97+
/// where <paramref name="optionName"/> has already been added will overwrite the
98+
/// existing value with the new value in <paramref name="optionValue"/>.
99+
/// Calling this method adds capabilities to the Edge-specific options object passed to
100+
/// webdriver executable (property name 'ms:edgeOptions').</remarks>
101+
public void AddAdditionalEdgeOption(string optionName, object optionValue)
102+
{
103+
this.AddAdditionalChromiumOption(optionName, optionValue);
104+
}
85105
}
86106
}

0 commit comments

Comments
 (0)