-
Notifications
You must be signed in to change notification settings - Fork 294
Support applications with multiple webviews. Add scrolling to the visible webview. #329
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
Conversation
…ting Webelement; instead of the whole application
element = self._element_find(locator, True, True) | ||
script = 'arguments[0].scrollIntoView()' | ||
# pylint: disable=no-member | ||
self._current_application().execute_script(script, element) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this apply to both ios and android
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed to work for scrolling elements in a webview on both Android and iOS.
AppiumLibrary/keywords/_element.py
Outdated
elif isinstance(locator, WebElement): | ||
return locator | ||
|
||
def get_webelements_no_error(self, locator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does no_error means in the name of the method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, I'm new to git and didn't mean to add this this function to the pull request. I thought I could pick and choose commits that would make sense to everyone. the intention though is if the webelement query finds no webelements, instead of throwing an error, it returns an empty array so you can do a get length on it. I still need to experiment if I can accomplish the same thing with a Run Keyword And Continue on Failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this function entirely. It can be handled via Run Keyword And Continue On Failure
AppiumLibrary/keywords/_element.py
Outdated
return element | ||
|
||
def get_webelement_in_webelement(self, element, locator): | ||
# def _element_find(self, locator, first_only, required, tag=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment pleaes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up the comments
Implements
This provides the users with the ability to select navigate through multiple webviews after they have selected the webview context (instead of NATIVE_APP).
This also provides a built in way to scroll to an element to make it visible.
This provides the ability to narrow a search for a webelement to a child of an existing webelement.
Fixing