Skip to content

Commit

Permalink
Removing deprecated methods from .NET bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jun 30, 2018
1 parent b2d4df6 commit d006b4c
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 385 deletions.
20 changes: 0 additions & 20 deletions dotnet/src/support/Events/EventFiringWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,16 +617,6 @@ protected virtual void OnElementClicked(WebElementEventArgs e)
}
}

/// <summary>
/// Raises the <see cref="ElementValueChanging"/> event.
/// </summary>
/// <param name="e">A <see cref="WebElementEventArgs"/> that contains the event data.</param>
[Obsolete("Use the new overload that takes a WebElementValueEventArgs argument")]
protected virtual void OnElementValueChanging(WebElementEventArgs e)
{
this.OnElementValueChanging(new WebElementValueEventArgs(e.Driver, e.Element, null));
}

/// <summary>
/// Raises the <see cref="ElementValueChanging"/> event.
/// </summary>
Expand All @@ -639,16 +629,6 @@ protected virtual void OnElementValueChanging(WebElementValueEventArgs e)
}
}

/// <summary>
/// Raises the <see cref="ElementValueChanged"/> event.
/// </summary>
/// <param name="e">A <see cref="WebElementEventArgs"/> that contains the event data.</param>
[Obsolete("Use the new overload that takes a WebElementValueEventArgs argument")]
protected virtual void OnElementValueChanged(WebElementEventArgs e)
{
this.OnElementValueChanged(e);
}

/// <summary>
/// Raises the <see cref="ElementValueChanged"/> event.
/// </summary>
Expand Down
14 changes: 0 additions & 14 deletions dotnet/src/webdriver/Chrome/ChromePerformanceLoggingPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class ChromePerformanceLoggingPreferences
{
private bool isCollectingNetworkEvents = true;
private bool isCollectingPageEvents = true;
private bool isCollectingTimelineEvents = true;
private TimeSpan bufferUsageReportingInterval = TimeSpan.FromMilliseconds(1000);
private List<string> tracingCategories = new List<string>();

Expand All @@ -53,18 +52,6 @@ public bool IsCollectingPageEvents
set { this.isCollectingPageEvents = value; }
}

/// <summary>
/// Gets or sets a value indicating whether Chrome will collect events from the Timeline domain.
/// Defaults to <see langword="true"/>, but is set to <see langword="false"/> when tracing
/// is enabled by adding one or more tracing categories.
/// </summary>
[Obsolete("Setting 'enableTimeline is no longer supported by chromedriver. This preference will no longer be sent to chromedriver. This property will be removed in a future release.")]
public bool IsCollectingTimelineEvents
{
get { return this.isCollectingTimelineEvents; }
set { this.isCollectingTimelineEvents = value; }
}

/// <summary>
/// Gets or sets the interval between Chrome DevTools trace buffer usage events.
/// Defaults to 1000 milliseconds.
Expand Down Expand Up @@ -140,7 +127,6 @@ public void AddTracingCategories(IEnumerable<string> categoriesToAdd)
}

// Adding a tracing category automatically turns timeline events off.
this.isCollectingTimelineEvents = false;
this.tracingCategories.AddRange(categoriesToAdd);
}
}
Expand Down
49 changes: 0 additions & 49 deletions dotnet/src/webdriver/Firefox/FirefoxDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,55 +106,6 @@ public FirefoxDriver()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given profile.
/// </summary>
/// <param name="profile">A <see cref="FirefoxProfile"/> object representing the profile settings
/// to be used in starting Firefox.</param>
[Obsolete("FirefoxDriver should not be constructed with a FirefoxProfile object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
public FirefoxDriver(FirefoxProfile profile)
: this(new FirefoxOptions(profile, null, null))
{
}

/// <summary>
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given set of capabilities.
/// </summary>
/// <param name="capabilities">The <see cref="ICapabilities"/> object containing the desired
/// capabilities of this FirefoxDriver.</param>
[Obsolete("FirefoxDriver should not be constructed with a raw ICapabilities or DesiredCapabilities object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
public FirefoxDriver(ICapabilities capabilities)
: this(CreateOptionsFromCapabilities(capabilities))
{
}

/// <summary>
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given profile and binary environment.
/// </summary>
/// <param name="binary">A <see cref="FirefoxBinary"/> object representing the operating system
/// environmental settings used when running Firefox.</param>
/// <param name="profile">A <see cref="FirefoxProfile"/> object representing the profile settings
/// to be used in starting Firefox.</param>
[Obsolete("FirefoxDriver should not be constructed with a FirefoxBinary object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile)
: this(new FirefoxOptions(profile, binary, null))
{
}

/// <summary>
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given profile, binary environment, and timeout value.
/// </summary>
/// <param name="binary">A <see cref="FirefoxBinary"/> object representing the operating system
/// environmental settings used when running Firefox.</param>
/// <param name="profile">A <see cref="FirefoxProfile"/> object representing the profile settings
/// to be used in starting Firefox.</param>
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
[Obsolete("FirefoxDriver should not be constructed with a FirefoxBinary object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile, TimeSpan commandTimeout)
: this((FirefoxDriverService)null, new FirefoxOptions(profile, binary, null), commandTimeout)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options. Uses the Mozilla-provided Marionette driver implementation.
/// </summary>
Expand Down
10 changes: 1 addition & 9 deletions dotnet/src/webdriver/Firefox/Internal/ILock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="ILock.cs" company="WebDriver Committers">
// <copyright file="ILock.cs" company="WebDriver Committers">
// 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
Expand Down Expand Up @@ -26,14 +26,6 @@ namespace OpenQA.Selenium.Firefox.Internal
/// </summary>
internal interface ILock : IDisposable
{
/// <summary>
/// Locks the mutex port.
/// </summary>
/// <param name="timeoutInMilliseconds">The amount of time (in milliseconds) to wait for
/// the mutex port to become available.</param>
[Obsolete("Timeouts should be expressed as a TimeSpan. Use the LockObject overload taking a TimeSpan parameter instead")]
void LockObject(long timeoutInMilliseconds);

/// <summary>
/// Locks the mutex port.
/// </summary>
Expand Down
13 changes: 1 addition & 12 deletions dotnet/src/webdriver/Firefox/Internal/SocketLock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="SocketLock.cs" company="WebDriver Committers">
// <copyright file="SocketLock.cs" company="WebDriver Committers">
// 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
Expand Down Expand Up @@ -99,17 +99,6 @@ public void LockObject(TimeSpan timeout)
throw new WebDriverException(string.Format(CultureInfo.InvariantCulture, "Unable to bind to locking port {0} within {1} milliseconds", this.lockPort, timeout.TotalMilliseconds));
}

/// <summary>
/// Locks the mutex port.
/// </summary>
/// <param name="timeoutInMilliseconds">The amount of time (in milliseconds) to wait for
/// the mutex port to become available.</param>
[Obsolete("Timeouts should be expressed as a TimeSpan. Use the LockObject overload taking a TimeSpan parameter instead")]
public void LockObject(long timeoutInMilliseconds)
{
this.LockObject(TimeSpan.FromMilliseconds(timeoutInMilliseconds));
}

/// <summary>
/// Unlocks the mutex port.
/// </summary>
Expand Down
61 changes: 0 additions & 61 deletions dotnet/src/webdriver/IE/InternetExplorerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,6 @@ public InternetExplorerElementScrollBehavior ElementScrollBehavior
set { this.elementScrollBehavior = value; }
}

/// <summary>
/// Gets or sets the value for describing how unexpected alerts are to be handled in the IE driver.
/// Defaults to <see cref="InternetExplorerUnexpectedAlertBehavior.Default"/>.
/// </summary>
[Obsolete("This property is being replaced by the UnhandledPromptBehavior property, and will be removed in a future version of the .NET bindings. Please use that instead.")]
public InternetExplorerUnexpectedAlertBehavior UnexpectedAlertBehavior
{
get { return this.GetUnexpectedAlertBehavior(); }
set { this.SetUnhandledPromptBehavior(value); }
}

/// <summary>
/// Gets or sets a value indicating whether to enable persistently sending WM_MOUSEMOVE messages
/// to the IE window during a mouse hover.
Expand Down Expand Up @@ -318,17 +307,6 @@ public bool EnsureCleanSession
set { this.ensureCleanSession = value; }
}

/// <summary>
/// Gets or sets a value indicating whether to enable full-page screenshots for
/// the IE driver. Defaults to <see langword="true"/>.
/// </summary>
[Obsolete("The driver no longer supports this capability. It will be removed in a future release.")]
public bool EnableFullPageScreenshot
{
get { return this.enableFullPageScreenshot; }
set { this.enableFullPageScreenshot = value; }
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Internet Explorer driver.
Expand Down Expand Up @@ -495,44 +473,5 @@ private Dictionary<string, object> BuildInternetExplorerOptionsDictionary()

return internetExplorerOptionsDictionary;
}

private void SetUnhandledPromptBehavior(InternetExplorerUnexpectedAlertBehavior unexpectedAlertBehavior)
{
switch (unexpectedAlertBehavior)
{
case InternetExplorerUnexpectedAlertBehavior.Accept:
this.UnhandledPromptBehavior = UnhandledPromptBehavior.AcceptAndNotify;
break;

case InternetExplorerUnexpectedAlertBehavior.Dismiss:
this.UnhandledPromptBehavior = UnhandledPromptBehavior.DismissAndNotify;
break;

case InternetExplorerUnexpectedAlertBehavior.Ignore:
this.UnhandledPromptBehavior = UnhandledPromptBehavior.Ignore;
break;

default:
this.UnhandledPromptBehavior = UnhandledPromptBehavior.Default;
break;
}
}

private InternetExplorerUnexpectedAlertBehavior GetUnexpectedAlertBehavior()
{
switch (this.UnhandledPromptBehavior)
{
case UnhandledPromptBehavior.AcceptAndNotify:
return InternetExplorerUnexpectedAlertBehavior.Accept;

case UnhandledPromptBehavior.DismissAndNotify:
return InternetExplorerUnexpectedAlertBehavior.Dismiss;

case UnhandledPromptBehavior.Ignore:
return InternetExplorerUnexpectedAlertBehavior.Ignore;
}

return InternetExplorerUnexpectedAlertBehavior.Default;
}
}
}
128 changes: 0 additions & 128 deletions dotnet/src/webdriver/Remote/DesiredCapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,134 +185,6 @@ internal Dictionary<string, object> CapabilitiesDictionary
get { return this.capabilities; }
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Firefox</returns>
[Obsolete("Use the FirefoxOptions class to set capabilities for use with Firefox. For use with the Java remote server or grid, use the ToCapabilites method of the FirefoxOptions class.")]
public static DesiredCapabilities Firefox()
{
DesiredCapabilities dc = new DesiredCapabilities("firefox", string.Empty, new Platform(PlatformType.Any));
dc.AcceptInsecureCerts = true;
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Firefox</returns>
public static DesiredCapabilities PhantomJS()
{
DesiredCapabilities dc = new DesiredCapabilities("phantomjs", string.Empty, new Platform(PlatformType.Any));
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Internet Explorer</returns>
[Obsolete("Use the InternetExplorerOptions class to set capabilities for use with Internet Explorer. For use with the Java remote server or grid, use the ToCapabilites method of the InternetExplorerOptions class.")]
public static DesiredCapabilities InternetExplorer()
{
return new DesiredCapabilities("internet explorer", string.Empty, new Platform(PlatformType.Windows));
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Microsoft Edge</returns>
[Obsolete("Use the EdgeOptions class to set capabilities for use with Edge. For use with the Java remote server or grid, use the ToCapabilites method of the EdgeOptions class.")]
public static DesiredCapabilities Edge()
{
DesiredCapabilities dc = new DesiredCapabilities("MicrosoftEdge", string.Empty, new Platform(PlatformType.Windows));
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with HTMLUnit</returns>
public static DesiredCapabilities HtmlUnit()
{
DesiredCapabilities dc = new DesiredCapabilities("htmlunit", string.Empty, new Platform(PlatformType.Any));
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with HTMLUnit with JS</returns>
public static DesiredCapabilities HtmlUnitWithJavaScript()
{
DesiredCapabilities dc = new DesiredCapabilities("htmlunit", string.Empty, new Platform(PlatformType.Any));
dc.SetCapability(CapabilityType.IsJavaScriptEnabled, true);
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with iPhone</returns>
[Obsolete("Selenium no longer provides an iOS device driver.")]
public static DesiredCapabilities IPhone()
{
return new DesiredCapabilities("iPhone", string.Empty, new Platform(PlatformType.Mac));
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with iPad</returns>
[Obsolete("Selenium no longer provides an iOS device driver.")]
public static DesiredCapabilities IPad()
{
return new DesiredCapabilities("iPad", string.Empty, new Platform(PlatformType.Mac));
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Chrome</returns>
[Obsolete("Use the ChromeOptions class to set capabilities for use with Chrome. For use with the Java remote server or grid, use the ToCapabilites method of the ChromeOptions class.")]
public static DesiredCapabilities Chrome()
{
// This is strangely inconsistent.
DesiredCapabilities dc = new DesiredCapabilities("chrome", string.Empty, new Platform(PlatformType.Any));
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Android</returns>
[Obsolete("Selenium no longer provides an Android device driver.")]
public static DesiredCapabilities Android()
{
return new DesiredCapabilities("android", string.Empty, new Platform(PlatformType.Android));
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Opera</returns>
[Obsolete("Use the OperaOptions class to set capabilities for use with Opera. For use with the Java remote server or grid, use the ToCapabilites method of the OperaOptions class.")]
public static DesiredCapabilities Opera()
{
DesiredCapabilities dc = new DesiredCapabilities("opera", string.Empty, new Platform(PlatformType.Any));
return dc;
}

/// <summary>
/// Method to return a new DesiredCapabilities using defaults
/// </summary>
/// <returns>New instance of DesiredCapabilities for use with Safari</returns>
[Obsolete("Use the SafariOptions class to set capabilities for use with Safari. For use with the Java remote server or grid, use the ToCapabilites method of the SafariOptions class.")]
public static DesiredCapabilities Safari()
{
DesiredCapabilities dc = new DesiredCapabilities("safari", string.Empty, new Platform(PlatformType.Mac));
return dc;
}

/// <summary>
/// Gets a value indicating whether the browser has a given capability.
/// </summary>
Expand Down
Loading

0 comments on commit d006b4c

Please sign in to comment.