diff --git a/dotnet/src/support/Events/EventFiringWebDriver.cs b/dotnet/src/support/Events/EventFiringWebDriver.cs index 46cf4aaf2fbcd..4d955f3ed845d 100644 --- a/dotnet/src/support/Events/EventFiringWebDriver.cs +++ b/dotnet/src/support/Events/EventFiringWebDriver.cs @@ -1419,20 +1419,6 @@ public void Submit() } } - public override bool Equals(object obj) - { - if (!(obj is IWebElement)) - return false; - - IWebElement other = (IWebElement)obj; - if(other is IWrapsElement wrapper) - { - other = ((IWrapsElement)wrapper).WrappedElement; - } - - return underlyingElement.Equals(other); - } - /// /// Click this element. If this causes a new page to load, this method will block until /// the page has loaded. At this point, you should discard all references to this element @@ -1574,6 +1560,28 @@ public ReadOnlyCollection FindElements(By by) return wrappedElementList.AsReadOnly(); } + + /// + /// Determines whether the specified is equal to the current . + /// + /// The to compare to the current . + /// if the specified is equal to the current ; otherwise, . + public override bool Equals(object obj) + { + IWebElement other = obj as IWebElement; + if (other == null) + { + return false; + } + + IWrapsElement otherWrapper = other as IWrapsElement; + if (otherWrapper != null) + { + other = otherWrapper.WrappedElement; + } + + return underlyingElement.Equals(other); + } } } }