Skip to content

Commit

Permalink
Use vendor-specific method names for additional Chromium options. (#9906
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bwalderman authored Oct 13, 2021
1 parent fce8ce0 commit b00c958
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
20 changes: 20 additions & 0 deletions dotnet/src/webdriver/Chrome/ChromeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,25 @@ public override string CapabilityName
{
get { return string.Format(CultureInfo.InvariantCulture, "{0}:{1}", this.VendorPrefix, ChromeOptionsCapabilityName); }
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Chrome driver.
/// </summary>
/// <param name="optionName">The name of the capability to add.</param>
/// <param name="optionValue">The value of the capability to add.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalChromeOption(string, object)"/>
/// where <paramref name="optionName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="optionValue"/>.
/// Calling this method adds capabilities to the Chrome-specific options object passed to
/// webdriver executable (property name 'goog:chromeOptions').</remarks>
public void AddAdditionalChromeOption(string optionName, object optionValue)
{
this.AddAdditionalChromiumOption(optionName, optionValue);
}
}
}
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/Chromium/ChromiumOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,12 @@ public void AddWindowTypes(IEnumerable<string> windowTypesToAdd)
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalChromeOption(string, object)"/>
/// <remarks>Calling <see cref="AddAdditionalChromiumOption(string, object)"/>
/// where <paramref name="optionName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="optionValue"/>.
/// Calling this method adds capabilities to the Chrome-specific options object passed to
/// webdriver executable (property name 'goog:chromeOptions').</remarks>
public void AddAdditionalChromeOption(string optionName, object optionValue)
/// Calling this method adds capabilities to the Chromium-specific options object passed to
/// webdriver executable (e.g. property name 'goog:chromeOptions').</remarks>
protected void AddAdditionalChromiumOption(string optionName, object optionValue)
{
this.ValidateCapabilityName(optionName);
this.additionalChromeOptions[optionName] = optionValue;
Expand Down Expand Up @@ -554,7 +554,7 @@ public void AddAdditionalCapability(string capabilityName, object capabilityValu
}
else
{
this.AddAdditionalChromeOption(capabilityName, capabilityValue);
this.AddAdditionalChromiumOption(capabilityName, capabilityValue);
}
}

Expand Down
20 changes: 20 additions & 0 deletions dotnet/src/webdriver/Edge/EdgeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,25 @@ public bool UseWebView
get { return this.BrowserName == WebViewBrowserNameValue; }
set { this.BrowserName = value ? WebViewBrowserNameValue : DefaultBrowserNameValue; }
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Edge driver.
/// </summary>
/// <param name="optionName">The name of the capability to add.</param>
/// <param name="optionValue">The value of the capability to add.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalEdgeOption(string, object)"/>
/// where <paramref name="optionName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="optionValue"/>.
/// Calling this method adds capabilities to the Edge-specific options object passed to
/// webdriver executable (property name 'ms:edgeOptions').</remarks>
public void AddAdditionalEdgeOption(string optionName, object optionValue)
{
this.AddAdditionalChromiumOption(optionName, optionValue);
}
}
}

0 comments on commit b00c958

Please sign in to comment.