Skip to content

Commit 505b594

Browse files
authored
[dotnet] Remove obsoleted members/types for 4.30 (#15342)
1 parent 0bc8c54 commit 505b594

7 files changed

+3
-276
lines changed

dotnet/src/webdriver/ElementNotSelectableException.cs

-63
This file was deleted.

dotnet/src/webdriver/ElementNotVisibleException.cs

-63
This file was deleted.

dotnet/src/webdriver/IWebElement.cs

-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ public interface IWebElement : ISearchContext
104104
/// <see cref="Keys"/>.</remarks>
105105
/// <seealso cref="Keys"/>
106106
/// <exception cref="InvalidElementStateException">Thrown when the target element is not enabled.</exception>
107-
/// <exception cref="ElementNotVisibleException">Thrown when the target element is not visible.</exception>
108107
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
109108
void SendKeys(string text);
110109

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

dotnet/src/webdriver/Response.cs

+3-41
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,6 @@ public class Response
4040
Converters = { new ResponseValueJsonConverter() } // we still need it to make `Object` as `Dictionary`
4141
};
4242

43-
/// <summary>
44-
/// Initializes a new instance of the <see cref="Response"/> class
45-
/// </summary>
46-
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
47-
public Response()
48-
{
49-
}
50-
51-
/// <summary>
52-
/// Initializes a new instance of the <see cref="Response"/> class
53-
/// </summary>
54-
/// <param name="sessionId">Session ID in use</param>
55-
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
56-
public Response(SessionId? sessionId)
57-
{
58-
this.SessionId = sessionId?.ToString();
59-
}
60-
6143
/// <summary>
6244
/// Initializes a new instance of the <see cref="Response"/> class
6345
/// </summary>
@@ -66,11 +48,9 @@ public Response(SessionId? sessionId)
6648
/// <param name="status">The WebDriver result status of the response.</param>
6749
public Response(string? sessionId, object? value, WebDriverResult status)
6850
{
69-
#pragma warning disable CS0618 // Type or member is obsolete
7051
this.SessionId = sessionId;
7152
this.Value = value;
7253
this.Status = status;
73-
#pragma warning restore CS0618 // Type or member is obsolete
7454
}
7555

7656
/// <summary>
@@ -141,35 +121,17 @@ public static Response FromJson(string value)
141121
/// <summary>
142122
/// Gets or sets the value from JSON.
143123
/// </summary>
144-
public object? Value
145-
{
146-
get;
147-
148-
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
149-
set;
150-
}
124+
public object? Value { get; }
151125

152126
/// <summary>
153127
/// Gets or sets the session ID.
154128
/// </summary>
155-
public string? SessionId
156-
{
157-
get;
158-
159-
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
160-
set;
161-
}
129+
public string? SessionId { get; }
162130

163131
/// <summary>
164132
/// Gets or sets the status value of the response.
165133
/// </summary>
166-
public WebDriverResult Status
167-
{
168-
get;
169-
170-
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
171-
set;
172-
}
134+
public WebDriverResult Status { get; }
173135

174136
/// <summary>
175137
/// Returns a new <see cref="Response"/> from a JSON-encoded string.

dotnet/src/webdriver/WebDriver.cs

-7
Original file line numberDiff line numberDiff line change
@@ -778,16 +778,9 @@ private static void UnpackAndThrowOnError(Response errorResponse, string command
778778
case WebDriverResult.ElementNotInteractable:
779779
throw new ElementNotInteractableException(errorMessage);
780780

781-
case WebDriverResult.ElementNotDisplayed:
782-
throw new ElementNotVisibleException(errorMessage);
783-
784781
case WebDriverResult.InvalidElementState:
785-
case WebDriverResult.ElementNotSelectable:
786782
throw new InvalidElementStateException(errorMessage);
787783

788-
case WebDriverResult.NoSuchDocument:
789-
throw new NoSuchElementException(errorMessage);
790-
791784
case WebDriverResult.Timeout:
792785
throw new WebDriverTimeoutException(errorMessage);
793786

dotnet/src/webdriver/WebDriverResult.cs

-98
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
// under the License.
1818
// </copyright>
1919

20-
using System;
21-
2220
#nullable enable
2321

2422
namespace OpenQA.Selenium
@@ -33,36 +31,6 @@ public enum WebDriverResult
3331
/// </summary>
3432
Success = 0,
3533

36-
/// <summary>
37-
/// The index specified for the action was out of the acceptable range.
38-
/// </summary>
39-
[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")]
40-
IndexOutOfBounds = 1,
41-
42-
/// <summary>
43-
/// No collection was specified.
44-
/// </summary>
45-
[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")]
46-
NoCollection = 2,
47-
48-
/// <summary>
49-
/// No string was specified.
50-
/// </summary>
51-
[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")]
52-
NoString = 3,
53-
54-
/// <summary>
55-
/// No string length was specified.
56-
/// </summary>
57-
[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")]
58-
NoStringLength = 4,
59-
60-
/// <summary>
61-
/// No string wrapper was specified.
62-
/// </summary>
63-
[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")]
64-
NoStringWrapper = 5,
65-
6634
/// <summary>
6735
/// 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.
6836
/// </summary>
@@ -88,12 +56,6 @@ public enum WebDriverResult
8856
/// </summary>
8957
ObsoleteElement = 10,
9058

91-
/// <summary>
92-
/// The specified element is not displayed.
93-
/// </summary>
94-
[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")]
95-
ElementNotDisplayed = 11,
96-
9759
/// <summary>
9860
/// 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>.
9961
/// </summary>
@@ -104,64 +66,16 @@ public enum WebDriverResult
10466
/// </summary>
10567
UnknownError = 13,
10668

107-
/// <summary>
108-
/// An unhandled error occurred.
109-
/// </summary>
110-
[Obsolete("This value is no longer set for unknown errors: use UnknownError instead. Will be removed in 4.30")]
111-
UnhandledError = UnknownError,
112-
113-
/// <summary>
114-
/// An error occurred, but it was expected.
115-
/// </summary>
116-
[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")]
117-
ExpectedError = 14,
118-
119-
/// <summary>
120-
/// The specified element is not selected.
121-
/// </summary>
122-
[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")]
123-
ElementNotSelectable = 15,
124-
125-
/// <summary>
126-
/// No document matching the criteria exists.
127-
/// </summary>
128-
[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")]
129-
NoSuchDocument = 16,
130-
13169
/// <summary>
13270
/// An error occurred while executing JavaScript supplied by the user.
13371
/// </summary>
13472
UnexpectedJavaScriptError = 17,
13573

136-
/// <summary>
137-
/// No result is available from the JavaScript execution.
138-
/// </summary>
139-
[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")]
140-
NoScriptResult = 18,
141-
142-
/// <summary>
143-
/// The result from the JavaScript execution is not recognized.
144-
/// </summary>
145-
[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")]
146-
XPathLookupError = 19,
147-
148-
/// <summary>
149-
/// No collection matching the criteria exists.
150-
/// </summary>
151-
[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")]
152-
NoSuchCollection = 20,
153-
15474
/// <summary>
15575
/// An operation did not complete before its timeout expired.
15676
/// </summary>
15777
Timeout = 21,
15878

159-
/// <summary>
160-
/// A null pointer was received.
161-
/// </summary>
162-
[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")]
163-
NullPointer = 22,
164-
16579
/// <summary>
16680
/// A command to switch to a window could not be satisfied because the window could not be found.
16781
/// </summary>
@@ -192,12 +106,6 @@ public enum WebDriverResult
192106
/// </summary>
193107
AsyncScriptTimeout = 28,
194108

195-
/// <summary>
196-
/// The coordinates of the element are invalid.
197-
/// </summary>
198-
[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")]
199-
InvalidElementCoordinates = 29,
200-
201109
/// <summary>
202110
/// Argument was an invalid selector.
203111
/// </summary>
@@ -213,12 +121,6 @@ public enum WebDriverResult
213121
/// </summary>
214122
MoveTargetOutOfBounds = 34,
215123

216-
/// <summary>
217-
/// The XPath selector was invalid.
218-
/// </summary>
219-
[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")]
220-
InvalidXPathSelector = 51,
221-
222124
/// <summary>
223125
/// Navigation caused the user agent to hit a certificate warning, which is usually the result of an expired or invalid TLS certificate.
224126
/// </summary>

0 commit comments

Comments
 (0)