Skip to content

Commit 2976ad5

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

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Diff for: py/selenium/webdriver/remote/webelement.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,7 @@ def id(self):
385385
return self._id
386386

387387
def __eq__(self, element):
388-
if self._id == element.id:
389-
return True
390-
else:
391-
return self._execute(Command.ELEMENT_EQUALS, {'other': element.id})['value']
388+
return self._id == element.id
392389

393390
# Private Methods
394391
def _execute(self, command, params=None):

Diff for: rb/lib/selenium/webdriver/remote/bridge.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,7 @@ def getElementValueOfCssProperty(element, prop)
582582
end
583583

584584
def elementEquals(element, other)
585-
if element.ref == other.ref
586-
true
587-
else
588-
execute :elementEquals, :id => element.ref, :other => other.ref
589-
end
585+
element.ref == other.ref
590586
end
591587

592588
#

0 commit comments

Comments
 (0)