Skip to content

Commit d006b4c

Browse files
committed
Removing deprecated methods from .NET bindings
1 parent b2d4df6 commit d006b4c

12 files changed

Lines changed: 23 additions & 385 deletions

dotnet/src/support/Events/EventFiringWebDriver.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -617,16 +617,6 @@ protected virtual void OnElementClicked(WebElementEventArgs e)
617617
}
618618
}
619619

620-
/// <summary>
621-
/// Raises the <see cref="ElementValueChanging"/> event.
622-
/// </summary>
623-
/// <param name="e">A <see cref="WebElementEventArgs"/> that contains the event data.</param>
624-
[Obsolete("Use the new overload that takes a WebElementValueEventArgs argument")]
625-
protected virtual void OnElementValueChanging(WebElementEventArgs e)
626-
{
627-
this.OnElementValueChanging(new WebElementValueEventArgs(e.Driver, e.Element, null));
628-
}
629-
630620
/// <summary>
631621
/// Raises the <see cref="ElementValueChanging"/> event.
632622
/// </summary>
@@ -639,16 +629,6 @@ protected virtual void OnElementValueChanging(WebElementValueEventArgs e)
639629
}
640630
}
641631

642-
/// <summary>
643-
/// Raises the <see cref="ElementValueChanged"/> event.
644-
/// </summary>
645-
/// <param name="e">A <see cref="WebElementEventArgs"/> that contains the event data.</param>
646-
[Obsolete("Use the new overload that takes a WebElementValueEventArgs argument")]
647-
protected virtual void OnElementValueChanged(WebElementEventArgs e)
648-
{
649-
this.OnElementValueChanged(e);
650-
}
651-
652632
/// <summary>
653633
/// Raises the <see cref="ElementValueChanged"/> event.
654634
/// </summary>

dotnet/src/webdriver/Chrome/ChromePerformanceLoggingPreferences.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public class ChromePerformanceLoggingPreferences
2929
{
3030
private bool isCollectingNetworkEvents = true;
3131
private bool isCollectingPageEvents = true;
32-
private bool isCollectingTimelineEvents = true;
3332
private TimeSpan bufferUsageReportingInterval = TimeSpan.FromMilliseconds(1000);
3433
private List<string> tracingCategories = new List<string>();
3534

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

56-
/// <summary>
57-
/// Gets or sets a value indicating whether Chrome will collect events from the Timeline domain.
58-
/// Defaults to <see langword="true"/>, but is set to <see langword="false"/> when tracing
59-
/// is enabled by adding one or more tracing categories.
60-
/// </summary>
61-
[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.")]
62-
public bool IsCollectingTimelineEvents
63-
{
64-
get { return this.isCollectingTimelineEvents; }
65-
set { this.isCollectingTimelineEvents = value; }
66-
}
67-
6855
/// <summary>
6956
/// Gets or sets the interval between Chrome DevTools trace buffer usage events.
7057
/// Defaults to 1000 milliseconds.
@@ -140,7 +127,6 @@ public void AddTracingCategories(IEnumerable<string> categoriesToAdd)
140127
}
141128

142129
// Adding a tracing category automatically turns timeline events off.
143-
this.isCollectingTimelineEvents = false;
144130
this.tracingCategories.AddRange(categoriesToAdd);
145131
}
146132
}

dotnet/src/webdriver/Firefox/FirefoxDriver.cs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -106,55 +106,6 @@ public FirefoxDriver()
106106
{
107107
}
108108

109-
/// <summary>
110-
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given profile.
111-
/// </summary>
112-
/// <param name="profile">A <see cref="FirefoxProfile"/> object representing the profile settings
113-
/// to be used in starting Firefox.</param>
114-
[Obsolete("FirefoxDriver should not be constructed with a FirefoxProfile object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
115-
public FirefoxDriver(FirefoxProfile profile)
116-
: this(new FirefoxOptions(profile, null, null))
117-
{
118-
}
119-
120-
/// <summary>
121-
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given set of capabilities.
122-
/// </summary>
123-
/// <param name="capabilities">The <see cref="ICapabilities"/> object containing the desired
124-
/// capabilities of this FirefoxDriver.</param>
125-
[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.")]
126-
public FirefoxDriver(ICapabilities capabilities)
127-
: this(CreateOptionsFromCapabilities(capabilities))
128-
{
129-
}
130-
131-
/// <summary>
132-
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given profile and binary environment.
133-
/// </summary>
134-
/// <param name="binary">A <see cref="FirefoxBinary"/> object representing the operating system
135-
/// environmental settings used when running Firefox.</param>
136-
/// <param name="profile">A <see cref="FirefoxProfile"/> object representing the profile settings
137-
/// to be used in starting Firefox.</param>
138-
[Obsolete("FirefoxDriver should not be constructed with a FirefoxBinary object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
139-
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile)
140-
: this(new FirefoxOptions(profile, binary, null))
141-
{
142-
}
143-
144-
/// <summary>
145-
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class for a given profile, binary environment, and timeout value.
146-
/// </summary>
147-
/// <param name="binary">A <see cref="FirefoxBinary"/> object representing the operating system
148-
/// environmental settings used when running Firefox.</param>
149-
/// <param name="profile">A <see cref="FirefoxProfile"/> object representing the profile settings
150-
/// to be used in starting Firefox.</param>
151-
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
152-
[Obsolete("FirefoxDriver should not be constructed with a FirefoxBinary object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]
153-
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile, TimeSpan commandTimeout)
154-
: this((FirefoxDriverService)null, new FirefoxOptions(profile, binary, null), commandTimeout)
155-
{
156-
}
157-
158109
/// <summary>
159110
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options. Uses the Mozilla-provided Marionette driver implementation.
160111
/// </summary>

dotnet/src/webdriver/Firefox/Internal/ILock.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="ILock.cs" company="WebDriver Committers">
1+
// <copyright file="ILock.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -26,14 +26,6 @@ namespace OpenQA.Selenium.Firefox.Internal
2626
/// </summary>
2727
internal interface ILock : IDisposable
2828
{
29-
/// <summary>
30-
/// Locks the mutex port.
31-
/// </summary>
32-
/// <param name="timeoutInMilliseconds">The amount of time (in milliseconds) to wait for
33-
/// the mutex port to become available.</param>
34-
[Obsolete("Timeouts should be expressed as a TimeSpan. Use the LockObject overload taking a TimeSpan parameter instead")]
35-
void LockObject(long timeoutInMilliseconds);
36-
3729
/// <summary>
3830
/// Locks the mutex port.
3931
/// </summary>

dotnet/src/webdriver/Firefox/Internal/SocketLock.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="SocketLock.cs" company="WebDriver Committers">
1+
// <copyright file="SocketLock.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -99,17 +99,6 @@ public void LockObject(TimeSpan timeout)
9999
throw new WebDriverException(string.Format(CultureInfo.InvariantCulture, "Unable to bind to locking port {0} within {1} milliseconds", this.lockPort, timeout.TotalMilliseconds));
100100
}
101101

102-
/// <summary>
103-
/// Locks the mutex port.
104-
/// </summary>
105-
/// <param name="timeoutInMilliseconds">The amount of time (in milliseconds) to wait for
106-
/// the mutex port to become available.</param>
107-
[Obsolete("Timeouts should be expressed as a TimeSpan. Use the LockObject overload taking a TimeSpan parameter instead")]
108-
public void LockObject(long timeoutInMilliseconds)
109-
{
110-
this.LockObject(TimeSpan.FromMilliseconds(timeoutInMilliseconds));
111-
}
112-
113102
/// <summary>
114103
/// Unlocks the mutex port.
115104
/// </summary>

dotnet/src/webdriver/IE/InternetExplorerOptions.cs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,6 @@ public InternetExplorerElementScrollBehavior ElementScrollBehavior
220220
set { this.elementScrollBehavior = value; }
221221
}
222222

223-
/// <summary>
224-
/// Gets or sets the value for describing how unexpected alerts are to be handled in the IE driver.
225-
/// Defaults to <see cref="InternetExplorerUnexpectedAlertBehavior.Default"/>.
226-
/// </summary>
227-
[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.")]
228-
public InternetExplorerUnexpectedAlertBehavior UnexpectedAlertBehavior
229-
{
230-
get { return this.GetUnexpectedAlertBehavior(); }
231-
set { this.SetUnhandledPromptBehavior(value); }
232-
}
233-
234223
/// <summary>
235224
/// Gets or sets a value indicating whether to enable persistently sending WM_MOUSEMOVE messages
236225
/// to the IE window during a mouse hover.
@@ -318,17 +307,6 @@ public bool EnsureCleanSession
318307
set { this.ensureCleanSession = value; }
319308
}
320309

321-
/// <summary>
322-
/// Gets or sets a value indicating whether to enable full-page screenshots for
323-
/// the IE driver. Defaults to <see langword="true"/>.
324-
/// </summary>
325-
[Obsolete("The driver no longer supports this capability. It will be removed in a future release.")]
326-
public bool EnableFullPageScreenshot
327-
{
328-
get { return this.enableFullPageScreenshot; }
329-
set { this.enableFullPageScreenshot = value; }
330-
}
331-
332310
/// <summary>
333311
/// Provides a means to add additional capabilities not yet added as type safe options
334312
/// for the Internet Explorer driver.
@@ -495,44 +473,5 @@ private Dictionary<string, object> BuildInternetExplorerOptionsDictionary()
495473

496474
return internetExplorerOptionsDictionary;
497475
}
498-
499-
private void SetUnhandledPromptBehavior(InternetExplorerUnexpectedAlertBehavior unexpectedAlertBehavior)
500-
{
501-
switch (unexpectedAlertBehavior)
502-
{
503-
case InternetExplorerUnexpectedAlertBehavior.Accept:
504-
this.UnhandledPromptBehavior = UnhandledPromptBehavior.AcceptAndNotify;
505-
break;
506-
507-
case InternetExplorerUnexpectedAlertBehavior.Dismiss:
508-
this.UnhandledPromptBehavior = UnhandledPromptBehavior.DismissAndNotify;
509-
break;
510-
511-
case InternetExplorerUnexpectedAlertBehavior.Ignore:
512-
this.UnhandledPromptBehavior = UnhandledPromptBehavior.Ignore;
513-
break;
514-
515-
default:
516-
this.UnhandledPromptBehavior = UnhandledPromptBehavior.Default;
517-
break;
518-
}
519-
}
520-
521-
private InternetExplorerUnexpectedAlertBehavior GetUnexpectedAlertBehavior()
522-
{
523-
switch (this.UnhandledPromptBehavior)
524-
{
525-
case UnhandledPromptBehavior.AcceptAndNotify:
526-
return InternetExplorerUnexpectedAlertBehavior.Accept;
527-
528-
case UnhandledPromptBehavior.DismissAndNotify:
529-
return InternetExplorerUnexpectedAlertBehavior.Dismiss;
530-
531-
case UnhandledPromptBehavior.Ignore:
532-
return InternetExplorerUnexpectedAlertBehavior.Ignore;
533-
}
534-
535-
return InternetExplorerUnexpectedAlertBehavior.Default;
536-
}
537476
}
538477
}

dotnet/src/webdriver/Remote/DesiredCapabilities.cs

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -185,134 +185,6 @@ internal Dictionary<string, object> CapabilitiesDictionary
185185
get { return this.capabilities; }
186186
}
187187

188-
/// <summary>
189-
/// Method to return a new DesiredCapabilities using defaults
190-
/// </summary>
191-
/// <returns>New instance of DesiredCapabilities for use with Firefox</returns>
192-
[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.")]
193-
public static DesiredCapabilities Firefox()
194-
{
195-
DesiredCapabilities dc = new DesiredCapabilities("firefox", string.Empty, new Platform(PlatformType.Any));
196-
dc.AcceptInsecureCerts = true;
197-
return dc;
198-
}
199-
200-
/// <summary>
201-
/// Method to return a new DesiredCapabilities using defaults
202-
/// </summary>
203-
/// <returns>New instance of DesiredCapabilities for use with Firefox</returns>
204-
public static DesiredCapabilities PhantomJS()
205-
{
206-
DesiredCapabilities dc = new DesiredCapabilities("phantomjs", string.Empty, new Platform(PlatformType.Any));
207-
return dc;
208-
}
209-
210-
/// <summary>
211-
/// Method to return a new DesiredCapabilities using defaults
212-
/// </summary>
213-
/// <returns>New instance of DesiredCapabilities for use with Internet Explorer</returns>
214-
[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.")]
215-
public static DesiredCapabilities InternetExplorer()
216-
{
217-
return new DesiredCapabilities("internet explorer", string.Empty, new Platform(PlatformType.Windows));
218-
}
219-
220-
/// <summary>
221-
/// Method to return a new DesiredCapabilities using defaults
222-
/// </summary>
223-
/// <returns>New instance of DesiredCapabilities for use with Microsoft Edge</returns>
224-
[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.")]
225-
public static DesiredCapabilities Edge()
226-
{
227-
DesiredCapabilities dc = new DesiredCapabilities("MicrosoftEdge", string.Empty, new Platform(PlatformType.Windows));
228-
return dc;
229-
}
230-
231-
/// <summary>
232-
/// Method to return a new DesiredCapabilities using defaults
233-
/// </summary>
234-
/// <returns>New instance of DesiredCapabilities for use with HTMLUnit</returns>
235-
public static DesiredCapabilities HtmlUnit()
236-
{
237-
DesiredCapabilities dc = new DesiredCapabilities("htmlunit", string.Empty, new Platform(PlatformType.Any));
238-
return dc;
239-
}
240-
241-
/// <summary>
242-
/// Method to return a new DesiredCapabilities using defaults
243-
/// </summary>
244-
/// <returns>New instance of DesiredCapabilities for use with HTMLUnit with JS</returns>
245-
public static DesiredCapabilities HtmlUnitWithJavaScript()
246-
{
247-
DesiredCapabilities dc = new DesiredCapabilities("htmlunit", string.Empty, new Platform(PlatformType.Any));
248-
dc.SetCapability(CapabilityType.IsJavaScriptEnabled, true);
249-
return dc;
250-
}
251-
252-
/// <summary>
253-
/// Method to return a new DesiredCapabilities using defaults
254-
/// </summary>
255-
/// <returns>New instance of DesiredCapabilities for use with iPhone</returns>
256-
[Obsolete("Selenium no longer provides an iOS device driver.")]
257-
public static DesiredCapabilities IPhone()
258-
{
259-
return new DesiredCapabilities("iPhone", string.Empty, new Platform(PlatformType.Mac));
260-
}
261-
262-
/// <summary>
263-
/// Method to return a new DesiredCapabilities using defaults
264-
/// </summary>
265-
/// <returns>New instance of DesiredCapabilities for use with iPad</returns>
266-
[Obsolete("Selenium no longer provides an iOS device driver.")]
267-
public static DesiredCapabilities IPad()
268-
{
269-
return new DesiredCapabilities("iPad", string.Empty, new Platform(PlatformType.Mac));
270-
}
271-
272-
/// <summary>
273-
/// Method to return a new DesiredCapabilities using defaults
274-
/// </summary>
275-
/// <returns>New instance of DesiredCapabilities for use with Chrome</returns>
276-
[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.")]
277-
public static DesiredCapabilities Chrome()
278-
{
279-
// This is strangely inconsistent.
280-
DesiredCapabilities dc = new DesiredCapabilities("chrome", string.Empty, new Platform(PlatformType.Any));
281-
return dc;
282-
}
283-
284-
/// <summary>
285-
/// Method to return a new DesiredCapabilities using defaults
286-
/// </summary>
287-
/// <returns>New instance of DesiredCapabilities for use with Android</returns>
288-
[Obsolete("Selenium no longer provides an Android device driver.")]
289-
public static DesiredCapabilities Android()
290-
{
291-
return new DesiredCapabilities("android", string.Empty, new Platform(PlatformType.Android));
292-
}
293-
294-
/// <summary>
295-
/// Method to return a new DesiredCapabilities using defaults
296-
/// </summary>
297-
/// <returns>New instance of DesiredCapabilities for use with Opera</returns>
298-
[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.")]
299-
public static DesiredCapabilities Opera()
300-
{
301-
DesiredCapabilities dc = new DesiredCapabilities("opera", string.Empty, new Platform(PlatformType.Any));
302-
return dc;
303-
}
304-
305-
/// <summary>
306-
/// Method to return a new DesiredCapabilities using defaults
307-
/// </summary>
308-
/// <returns>New instance of DesiredCapabilities for use with Safari</returns>
309-
[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.")]
310-
public static DesiredCapabilities Safari()
311-
{
312-
DesiredCapabilities dc = new DesiredCapabilities("safari", string.Empty, new Platform(PlatformType.Mac));
313-
return dc;
314-
}
315-
316188
/// <summary>
317189
/// Gets a value indicating whether the browser has a given capability.
318190
/// </summary>

0 commit comments

Comments
 (0)