Skip to content

findElementsByClassName failure instantly terminates the test and cannot be handled #227

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

Open
interrobrian opened this issue Jun 6, 2019 · 1 comment

Comments

@interrobrian
Copy link
Contributor

Describe the bug
When calling findElementsByClassName, I'd like to continue if no elements are found. However, if no elements match the class name, my test instantly terminates like so:

Error: [waitForElementsByClassName("textfield",5000)] Element condition wasn't satisfied!

This happens even if my await driver.findElementsByClassName is surrounded by a try catch or has a .catch() on it. There seems to be no way to recover from or handle this error.

To Reproduce
Create an app with no TextFields, then make an end-to-end test and try findElementsByClassName("textfield").

Expected behavior
I believe any findElements... functions should return an empty array if no elements match the find criteria. At the very least, they should throw an Error instead of forcibly terminating the test.

@interrobrian interrobrian changed the title findElementsByClassName throws an unhandleable exception findElementsByClassName failure instantly terminates the test and cannot be handled Jun 6, 2019
@dkoudrinhc
Copy link

Any updates on this? It's a huge blocker for me.

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

2 participants