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

element.exists throws nerodia.exception.UnknownObjectException #34

Open
SinxRofozoteron opened this issue Dec 31, 2020 · 0 comments
Open

Comments

@SinxRofozoteron
Copy link

SinxRofozoteron commented Dec 31, 2020

Meta -

Nerodia Version: 0.14.1
Selenium Version: 3.141.0
Browser Version: Chrome 87.0.4280.88 (Official Build) (64-bit)
Browser Driver Version:
OS Version:

Expected Behavior -

element.exists supposed to return True or False

Actual Behavior -

element.exists throws UnknownObjectException

Steps to reproduce -

I'm trying to verify if ul tag object exists on the page:
Input:

exists = browser.ul(class_name="foo").exists
print(exists)

Output:

self = #<UList: located: False; {'class_name': 'foo', 'tag_name': 'ul'}>, condition = None, caller = '_elements'

    def _check_condition(self, condition, caller):
        nerodia.logger.debug('<- `Verifying precondition {}#{} for '
                             '{}`'.format(self, condition, caller))
        try:
            if not condition:
>               self.assert_exists()

c:\programdata\anaconda3\envs\stf\lib\site-packages\nerodia\elements\element.py:761:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = #<UList: located: False; {'class_name': 'foo', 'tag_name': 'ul'}>

    def assert_exists(self):
        """
        Locates if not previously found; does not check for staleness for performance reasons
        """
        if not self._located:
            self.locate()
        if not self._located:
>           raise self._unknown_exception('unable to locate element: {}'.format(self))
E           nerodia.exception.UnknownObjectException: unable to locate element: #<UList: located: False; {'class_name': 'foo', 'tag_name': 'ul'}>

c:\programdata\anaconda3\envs\stf\lib\site-packages\nerodia\elements\element.py:676: UnknownObjectException
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

No branches or pull requests

1 participant