Skip to content

Commit fdbcc71

Browse files
unknownunknown
authored andcommitted
Added the Equals method to the Window and Element objects
1 parent 9a706df commit fdbcc71

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

Selenium/ComInterfaces/_WebElement.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ public interface _WebElement {
249249
object WaitForScript(string script, object arguments, int timeout = -1);
250250

251251
#endregion
252+
253+
254+
[DispId(899), Description("Evaluate equality")]
255+
bool Equals(object obj);
252256
}
253257

254258
}

Selenium/ComInterfaces/_Window.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public interface _Window {
4949
[DispId(574), Description("Closes the current window")]
5050
void Close();
5151

52+
[DispId(899), Description("Evaluate equality")]
53+
bool Equals(object obj);
54+
5255
}
5356

5457
}

Selenium/Common/WebElement.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,13 +695,11 @@ private static object[] FormatArguments(object item, object arguments) {
695695
#region Protected support methods
696696

697697
/// <summary>
698-
///
698+
/// Determines whether the specified instances are considered equal.
699699
/// </summary>
700700
/// <param name="obj"></param>
701-
/// <returns></returns>
701+
/// <returns>True if equal, false otherwise.</returns>
702702
public override bool Equals(object obj) {
703-
if (obj == null)
704-
return false;
705703
WebElement element = obj as WebElement;
706704
if (element == null)
707705
return false;

Selenium/Common/Window.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public string Handle {
7171
}
7272

7373
/// <summary>
74-
/// Determines whether the specified System.Object instances are considered equal.
74+
/// Determines whether the specified instances are considered equal.
7575
/// </summary>
7676
/// <param name="obj">Object to compare.</param>
77-
/// <returns>true if the instances are equal; otherwise false.</returns>
77+
/// <returns>True if equal, false otherwise.</returns>
7878
public override bool Equals(object obj) {
7979
Window win = obj as Window;
8080
if (win == null)
@@ -184,7 +184,7 @@ public void Maximize() {
184184
/// Set the current window full screen.
185185
/// </summary>
186186
public void FullScreen() {
187-
throw new NotImplementedException();
187+
_session.Send(RequestMethod.POST, uri() + "/fullscreen");
188188
}
189189

190190
/// <summary>

0 commit comments

Comments
 (0)