Implement equals() and hashCode() in `Select` element wrapper
import org.openqa.selenium.WrapsElement;
import java.util.List;
+import java.util.Objects;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
@@ -311,4 +312,18 @@ private void setSelected(WebElement option, boolean select) {
option.click();
}
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof Select)) {
+ return false;
+ }
+ Select select = (Select) o;
+ return Objects.equals(element, select.element);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(element);
+ }
}
