Skip to content

Added get_element_rect #356

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

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions AppiumLibrary/keywords/_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,17 @@ def get_element_size(self, locator):
self._info("Element '%s' size: %s " % (locator, element_size))
return element_size

def get_element_rect(self, locator):
"""Gets dimensions and coordinates of an element

Key attributes for arbitrary elements are `id` and `name`. See
`introduction` for details about locating elements.
"""
element = self._element_find(locator, True, True)
element_rect = element.rect
self._info("Element '%s' rect: %s " % (locator, element_rect))
return element_rect

def get_text(self, locator):
"""Get element text (for hybrid and mobile browser use `xpath` locator, others might cause problem)

Expand Down