nightwatch: Throwing `TimeoutError` when chained .find() command fails
Description of the bug/issue
When .find() command is chained and it fails to resolve any element, it throws an TimeoutError instead of NoSuchElementError.
Branched off from issue: https://github.com/nightwatchjs/nightwatch/issues/3991 Reference comment: https://github.com/nightwatchjs/nightwatch/issues/3991#issuecomment-1969444042
Sample test
Just use browser.element.find('.invalid_selector'); in any Nightwatch example test and run the test.
Potential solution
We’d probably need to check if the error thrown by the .find() command is a timeout error and if so, change the error name accordingly.
After the fix, instead of a timeout error, we should get an error in the following format when Nightwatch is unable to find an element:
Nightwatch.js Version
3.3.7
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 18 (9 by maintainers)
Commits related to this issue
- Fixes #4078 Throw NoSuchElementError instead of Timeout Error — committed to Honey2339/nightwatch by Honey2339 4 months ago
Hey @Honey2339 I am not working on this currently, you can take this up.