Skip to content

element.exists throws nerodia.exception.UnknownObjectException #34

@SinxRofozoteron

Description

@SinxRofozoteron

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions