Skip to content

Commit dffd894

Browse files
committed
Obsolete webdriver results that W3C spec no longer returns
1 parent 1a6e524 commit dffd894

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

dotnet/src/webdriver/WebDriverError.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,12 @@ static WebDriverError()
224224
resultMap[UnsupportedOperation] = WebDriverResult.UnsupportedOperation;
225225

226226
// TODO: Remove these strings; it is no longer valid in the specification.
227+
#pragma warning disable CS0618 // Type or member is obsolete
227228
resultMap[ElementNotSelectable] = WebDriverResult.ElementNotSelectable;
228229
resultMap[ElementNotVisible] = WebDriverResult.ElementNotDisplayed;
229230
resultMap[InvalidCoordinates] = WebDriverResult.InvalidElementCoordinates;
230231
resultMap[InvalidElementCoordinates] = WebDriverResult.InvalidElementCoordinates;
232+
#pragma warning restore CS0618 // Type or member is obsolete
231233
}
232234

233235
/// <summary>

dotnet/src/webdriver/WebDriverResult.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,31 @@ public enum WebDriverResult
3434
/// <summary>
3535
/// The index specified for the action was out of the acceptable range.
3636
/// </summary>
37+
[Obsolete("This result is not returned by W3C specifications")]
3738
IndexOutOfBounds = 1,
3839

3940
/// <summary>
4041
/// No collection was specified.
4142
/// </summary>
43+
[Obsolete("This result is not returned by W3C specifications")]
4244
NoCollection = 2,
4345

4446
/// <summary>
4547
/// No string was specified.
4648
/// </summary>
49+
[Obsolete("This result is not returned by W3C specifications")]
4750
NoString = 3,
4851

4952
/// <summary>
5053
/// No string length was specified.
5154
/// </summary>
55+
[Obsolete("This result is not returned by W3C specifications")]
5256
NoStringLength = 4,
5357

5458
/// <summary>
5559
/// No string wrapper was specified.
5660
/// </summary>
61+
[Obsolete("This result is not returned by W3C specifications")]
5762
NoStringWrapper = 5,
5863

5964
/// <summary>
@@ -84,6 +89,7 @@ public enum WebDriverResult
8489
/// <summary>
8590
/// The specified element is not displayed.
8691
/// </summary>
92+
[Obsolete("This result is not returned by W3C specifications")]
8793
ElementNotDisplayed = 11,
8894

8995
/// <summary>
@@ -105,11 +111,13 @@ public enum WebDriverResult
105111
/// <summary>
106112
/// An error occurred, but it was expected.
107113
/// </summary>
114+
[Obsolete("This result is not returned by W3C specifications")]
108115
ExpectedError = 14,
109116

110117
/// <summary>
111118
/// The specified element is not selected.
112119
/// </summary>
120+
[Obsolete("This result is not returned by W3C specifications")]
113121
ElementNotSelectable = 15,
114122

115123
/// <summary>
@@ -125,16 +133,19 @@ public enum WebDriverResult
125133
/// <summary>
126134
/// No result is available from the JavaScript execution.
127135
/// </summary>
136+
[Obsolete("This result is not returned by W3C specifications")]
128137
NoScriptResult = 18,
129138

130139
/// <summary>
131140
/// The result from the JavaScript execution is not recognized.
132141
/// </summary>
142+
[Obsolete("This result is not returned by W3C specifications")]
133143
XPathLookupError = 19,
134144

135145
/// <summary>
136146
/// No collection matching the criteria exists.
137147
/// </summary>
148+
[Obsolete("This result is not returned by W3C specifications")]
138149
NoSuchCollection = 20,
139150

140151
/// <summary>
@@ -145,6 +156,7 @@ public enum WebDriverResult
145156
/// <summary>
146157
/// A null pointer was received.
147158
/// </summary>
159+
[Obsolete("This result is not returned by W3C specifications")]
148160
NullPointer = 22,
149161

150162
/// <summary>
@@ -180,6 +192,7 @@ public enum WebDriverResult
180192
/// <summary>
181193
/// The coordinates of the element are invalid.
182194
/// </summary>
195+
[Obsolete("This result is not returned by W3C specifications")]
183196
InvalidElementCoordinates = 29,
184197

185198
/// <summary>
@@ -200,6 +213,7 @@ public enum WebDriverResult
200213
/// <summary>
201214
/// The XPath selector was invalid.
202215
/// </summary>
216+
[Obsolete("This result is not returned by W3C specifications")]
203217
InvalidXPathSelector = 51,
204218

205219
/// <summary>

0 commit comments

Comments
 (0)