Skip to content

Commit 419a902

Browse files
committed
java: Comparing remote web element for equality does not require a remote command, comparing IDs is enough
1 parent c9bb8e4 commit 419a902

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

Diff for: java/client/src/org/openqa/selenium/remote/RemoteWebElement.java

+1-12
Original file line numberDiff line numberDiff line change
@@ -285,19 +285,8 @@ public boolean equals(Object obj) {
285285
}
286286

287287
RemoteWebElement otherRemoteWebElement = (RemoteWebElement) other;
288-
if (id.equals(otherRemoteWebElement.id)) {
289-
return true;
290-
}
291-
292-
if (parent != null) {
293-
//TODO(dawagner): Remove this fallback (and wire protocol method)
294-
Response response = execute(DriverCommand.ELEMENT_EQUALS,
295-
ImmutableMap.of("id", id, "other", otherRemoteWebElement.id));
296-
Object value = response.getValue();
297-
return value != null && value instanceof Boolean && (Boolean) value;
298-
}
299288

300-
return false;
289+
return id.equals(otherRemoteWebElement.id);
301290
}
302291

303292
/**

0 commit comments

Comments
 (0)