Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

w3c issue with def rect(self): #6355

Merged
merged 6 commits into from Sep 12, 2018
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion py/selenium/webdriver/remote/webelement.py
Expand Up @@ -539,7 +539,15 @@ def location(self):
@property
def rect(self):
"""A dictionary with the size and location of the element."""
return self._execute(Command.GET_ELEMENT_RECT)['value']
if self._w3c:
return self._execute(Command.GET_ELEMENT_RECT)['value']
else:
size = self._execute(Command.GET_ELEMENT_SIZE)['value']
loc = self._execute(Command.GET_ELEMENT_LOCATION)['value']

VladimirPodolian marked this conversation as resolved.
Show resolved Hide resolved
rect = {"height": size["height"], "width": size["width"],
"x": round(loc['x']), "y": round(loc['y'])}
return rect
VladimirPodolian marked this conversation as resolved.
Show resolved Hide resolved

@property
def screenshot_as_base64(self):
Expand Down