Skip to content

Commit

Permalink
[dotnet] Remove obsoleted members/types for 4.30 (#15342)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko authored Feb 25, 2025
1 parent 0bc8c54 commit 505b594
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 276 deletions.
63 changes: 0 additions & 63 deletions dotnet/src/webdriver/ElementNotSelectableException.cs

This file was deleted.

63 changes: 0 additions & 63 deletions dotnet/src/webdriver/ElementNotVisibleException.cs

This file was deleted.

2 changes: 0 additions & 2 deletions dotnet/src/webdriver/IWebElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public interface IWebElement : ISearchContext
/// <see cref="Keys"/>.</remarks>
/// <seealso cref="Keys"/>
/// <exception cref="InvalidElementStateException">Thrown when the target element is not enabled.</exception>
/// <exception cref="ElementNotVisibleException">Thrown when the target element is not visible.</exception>
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
void SendKeys(string text);

Expand Down Expand Up @@ -134,7 +133,6 @@ public interface IWebElement : ISearchContext
/// simulate a users to accidentally missing the target when clicking.
/// </para>
/// </remarks>
/// <exception cref="ElementNotVisibleException">Thrown when the target element is not visible.</exception>
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
void Click();

Expand Down
44 changes: 3 additions & 41 deletions dotnet/src/webdriver/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,6 @@ public class Response
Converters = { new ResponseValueJsonConverter() } // we still need it to make `Object` as `Dictionary`
};

/// <summary>
/// Initializes a new instance of the <see cref="Response"/> class
/// </summary>
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
public Response()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="Response"/> class
/// </summary>
/// <param name="sessionId">Session ID in use</param>
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
public Response(SessionId? sessionId)
{
this.SessionId = sessionId?.ToString();
}

/// <summary>
/// Initializes a new instance of the <see cref="Response"/> class
/// </summary>
Expand All @@ -66,11 +48,9 @@ public Response(SessionId? sessionId)
/// <param name="status">The WebDriver result status of the response.</param>
public Response(string? sessionId, object? value, WebDriverResult status)
{
#pragma warning disable CS0618 // Type or member is obsolete
this.SessionId = sessionId;
this.Value = value;
this.Status = status;
#pragma warning restore CS0618 // Type or member is obsolete
}

/// <summary>
Expand Down Expand Up @@ -141,35 +121,17 @@ public static Response FromJson(string value)
/// <summary>
/// Gets or sets the value from JSON.
/// </summary>
public object? Value
{
get;

[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
set;
}
public object? Value { get; }

/// <summary>
/// Gets or sets the session ID.
/// </summary>
public string? SessionId
{
get;

[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
set;
}
public string? SessionId { get; }

/// <summary>
/// Gets or sets the status value of the response.
/// </summary>
public WebDriverResult Status
{
get;

[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
set;
}
public WebDriverResult Status { get; }

/// <summary>
/// Returns a new <see cref="Response"/> from a JSON-encoded string.
Expand Down
7 changes: 0 additions & 7 deletions dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,16 +778,9 @@ private static void UnpackAndThrowOnError(Response errorResponse, string command
case WebDriverResult.ElementNotInteractable:
throw new ElementNotInteractableException(errorMessage);

case WebDriverResult.ElementNotDisplayed:
throw new ElementNotVisibleException(errorMessage);

case WebDriverResult.InvalidElementState:
case WebDriverResult.ElementNotSelectable:
throw new InvalidElementStateException(errorMessage);

case WebDriverResult.NoSuchDocument:
throw new NoSuchElementException(errorMessage);

case WebDriverResult.Timeout:
throw new WebDriverTimeoutException(errorMessage);

Expand Down
98 changes: 0 additions & 98 deletions dotnet/src/webdriver/WebDriverResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
// under the License.
// </copyright>

using System;

#nullable enable

namespace OpenQA.Selenium
Expand All @@ -33,36 +31,6 @@ public enum WebDriverResult
/// </summary>
Success = 0,

/// <summary>
/// The index specified for the action was out of the acceptable range.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
IndexOutOfBounds = 1,

/// <summary>
/// No collection was specified.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoCollection = 2,

/// <summary>
/// No string was specified.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoString = 3,

/// <summary>
/// No string length was specified.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoStringLength = 4,

/// <summary>
/// No string wrapper was specified.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoStringWrapper = 5,

/// <summary>
/// Occurs if the given <see href="https://www.w3.org/TR/webdriver2/#dfn-session-id">session id</see> is not in the list of <see href="https://www.w3.org/TR/webdriver2/#dfn-active-sessions">active sessions</see>, meaning the session either does not exist or that it's not active.
/// </summary>
Expand All @@ -88,12 +56,6 @@ public enum WebDriverResult
/// </summary>
ObsoleteElement = 10,

/// <summary>
/// The specified element is not displayed.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
ElementNotDisplayed = 11,

/// <summary>
/// A command could not be completed because the element is in an invalid state, e.g. attempting to <see href="https://www.w3.org/TR/webdriver2/#dfn-element-clear">clear</see> an element that isn't both <see href="https://www.w3.org/TR/webdriver2/#dfn-editable">editable</see> and <see href="https://www.w3.org/TR/webdriver2/#dfn-resettable-elements">resettable</see>.
/// </summary>
Expand All @@ -104,64 +66,16 @@ public enum WebDriverResult
/// </summary>
UnknownError = 13,

/// <summary>
/// An unhandled error occurred.
/// </summary>
[Obsolete("This value is no longer set for unknown errors: use UnknownError instead. Will be removed in 4.30")]
UnhandledError = UnknownError,

/// <summary>
/// An error occurred, but it was expected.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
ExpectedError = 14,

/// <summary>
/// The specified element is not selected.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
ElementNotSelectable = 15,

/// <summary>
/// No document matching the criteria exists.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoSuchDocument = 16,

/// <summary>
/// An error occurred while executing JavaScript supplied by the user.
/// </summary>
UnexpectedJavaScriptError = 17,

/// <summary>
/// No result is available from the JavaScript execution.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoScriptResult = 18,

/// <summary>
/// The result from the JavaScript execution is not recognized.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
XPathLookupError = 19,

/// <summary>
/// No collection matching the criteria exists.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NoSuchCollection = 20,

/// <summary>
/// An operation did not complete before its timeout expired.
/// </summary>
Timeout = 21,

/// <summary>
/// A null pointer was received.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
NullPointer = 22,

/// <summary>
/// A command to switch to a window could not be satisfied because the window could not be found.
/// </summary>
Expand Down Expand Up @@ -192,12 +106,6 @@ public enum WebDriverResult
/// </summary>
AsyncScriptTimeout = 28,

/// <summary>
/// The coordinates of the element are invalid.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
InvalidElementCoordinates = 29,

/// <summary>
/// Argument was an invalid selector.
/// </summary>
Expand All @@ -213,12 +121,6 @@ public enum WebDriverResult
/// </summary>
MoveTargetOutOfBounds = 34,

/// <summary>
/// The XPath selector was invalid.
/// </summary>
[Obsolete("This error status is no longer returned by the WebDriver Specification https://www.w3.org/TR/webdriver2/#errors. Will be removed in 4.30")]
InvalidXPathSelector = 51,

/// <summary>
/// Navigation caused the user agent to hit a certificate warning, which is usually the result of an expired or invalid TLS certificate.
/// </summary>
Expand Down
Loading

0 comments on commit 505b594

Please sign in to comment.