Skip to content

Commit 94db948

Browse files
committed
Adding additional specification error codesin .NET
1 parent 0e84431 commit 94db948

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

dotnet/src/webdriver/Remote/WebDriverError.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,51 @@ namespace OpenQA.Selenium.Remote
2626
/// </summary>
2727
internal static class WebDriverError
2828
{
29+
/// <summary>
30+
/// Represents the element click intercepted error.
31+
/// </summary>
32+
public const string ElementClickIntercepted = "element click intercepted";
33+
2934
/// <summary>
3035
/// Represents the element not selectable error.
3136
/// </summary>
3237
public const string ElementNotSelectable = "element not selectable";
3338

39+
/// <summary>
40+
/// Represents the element not interactable error.
41+
/// </summary>
42+
public const string ElementNotInteractable = "element not interactable";
43+
3444
/// <summary>
3545
/// Represents the element not visible error.
3646
/// </summary>
47+
/// TODO: Remove this string; it is no longer valid in the specification.
3748
public const string ElementNotVisible = "element not visible";
3849

50+
/// <summary>
51+
/// Represents the insecure certificate error.
52+
/// </summary>
53+
public const string InsecureCertificate = "insecure certificate";
54+
3955
/// <summary>
4056
/// Represents the invalid argument error.
4157
/// </summary>
4258
public const string InvalidArgument = "invalid argument";
4359

60+
/// <summary>
61+
/// Represents the invalid cookie domain error.
62+
/// </summary>
63+
public const string InvalidCookieDomain = "invalid cookie domain";
64+
65+
/// <summary>
66+
/// Represents the invalid coordinates error.
67+
/// </summary>
68+
public const string InvalidCoordinates = "invalid coordinates";
69+
4470
/// <summary>
4571
/// Represents the invalid element coordinates error.
4672
/// </summary>
73+
/// TODO: Remove this string; it is no longer valid in the specification.
4774
public const string InvalidElementCoordinates = "invalid element coordinates";
4875

4976
/// <summary>
@@ -76,6 +103,11 @@ internal static class WebDriverError
76103
/// </summary>
77104
public const string NoSuchAlert = "no such alert";
78105

106+
/// <summary>
107+
/// Represents the no such cookie error.
108+
/// </summary>
109+
public const string NoSuchCookie = "no such cookie";
110+
79111
/// <summary>
80112
/// Represents the no such element error.
81113
/// </summary>
@@ -173,14 +205,19 @@ private static void InitializeResultMap()
173205
resultMap = new Dictionary<string, WebDriverResult>();
174206
resultMap[ElementNotSelectable] = WebDriverResult.ElementNotSelectable;
175207
resultMap[ElementNotVisible] = WebDriverResult.ElementNotDisplayed;
208+
resultMap[ElementNotInteractable] = WebDriverResult.ElementNotDisplayed;
209+
resultMap[InsecureCertificate] = WebDriverResult.InsecureCertificate;
176210
resultMap[InvalidArgument] = WebDriverResult.IndexOutOfBounds;
211+
resultMap[InvalidCookieDomain] = WebDriverResult.InvalidCookieDomain;
212+
resultMap[InvalidCoordinates] = WebDriverResult.InvalidElementCoordinates;
177213
resultMap[InvalidElementCoordinates] = WebDriverResult.InvalidElementCoordinates;
178214
resultMap[InvalidElementState] = WebDriverResult.InvalidElementState;
179215
resultMap[InvalidSelector] = WebDriverResult.InvalidSelector;
180216
resultMap[InvalidSessionId] = WebDriverResult.NoSuchDriver;
181217
resultMap[JavaScriptError] = WebDriverResult.UnexpectedJavaScriptError;
182218
resultMap[MoveTargetOutOfBounds] = WebDriverResult.InvalidElementCoordinates;
183219
resultMap[NoSuchAlert] = WebDriverResult.NoAlertPresent;
220+
resultMap[NoSuchCookie] = WebDriverResult.NoSuchCookie;
184221
resultMap[NoSuchElement] = WebDriverResult.NoSuchElement;
185222
resultMap[NoSuchFrame] = WebDriverResult.NoSuchFrame;
186223
resultMap[NoSuchWindow] = WebDriverResult.NoSuchWindow;

dotnet/src/webdriver/WebDriverResult.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ public enum WebDriverResult
176176
/// <summary>
177177
/// The selector used (CSS/XPath) was invalid.
178178
/// </summary>
179-
InvalidSelector = 32
179+
InvalidSelector = 32,
180+
181+
/// <summary>
182+
/// An insecure SSl certificate was specified.
183+
/// </summary>
184+
InsecureCertificate = 33,
185+
186+
/// <summary>
187+
/// No cookie was found matching the name requested.
188+
/// </summary>
189+
NoSuchCookie = 34
180190
}
181191
}

0 commit comments

Comments
 (0)