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

NoSuchElementException is not catched when isPresent() is called #1415

Closed
vzakharchuk opened this issue Oct 17, 2018 · 1 comment
Closed
Labels

Comments

@vzakharchuk
Copy link

vzakharchuk commented Oct 17, 2018

Hey there,

The code below works fine, it catches the exception and returns boolean.
element(LOCATOR).isPresent().

Next example will fail with NoSuchElementException in case child element is absent in DOM.
element(PARENT_ELEMENT_LOCATOR).then(CHILD_ELEMENT_LOCATOR).isPresent().

Despite the fact that NotFoundException is catched in isPresent().
Could you please throw some light on it?

@vzakharchuk vzakharchuk changed the title isPresent() throws NoSuchElementException NoSuchElementException is not catched when isPresent() is called Oct 17, 2018
@wakaleo
Copy link
Member

wakaleo commented Oct 17, 2018

If element(PARENT_ELEMENT_LOCATOR) is not present than this will throw an exception.

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants