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

Support applications with multiple webviews. Add scrolling to the visible webview. #329

Merged
merged 7 commits into from
Dec 23, 2021

Conversation

matthew-dahm
Copy link
Contributor

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

element = self._element_find(locator, True, True)
script = 'arguments[0].scrollIntoView()'
# pylint: disable=no-member
self._current_application().execute_script(script, element)
Copy link
Owner

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

Copy link
Contributor Author

@matthew-dahm matthew-dahm Oct 12, 2021

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.

elif isinstance(locator, WebElement):
return locator

def get_webelements_no_error(self, locator):
Copy link
Owner

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

return element

def get_webelement_in_webelement(self, element, locator):
# def _element_find(self, locator, first_only, required, tag=None):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment pleaes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up the comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants