nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.85k stars 1.35k forks source link

Supress error for chained `.find()` command #4079

Closed dikwickley closed 1 month ago

dikwickley commented 9 months ago

Description of the bug/issue

Further chained .find() commands should not throw the Timeout or any other error again. Ex. in browser.element('.invalid-selector').find('selector').getText();, there should only be one error due to browser.element() and .find() should not throw an error again (suppress the error for it).

Branched off from issue: https://github.com/nightwatchjs/nightwatch/issues/3991 Reference comment: https://github.com/nightwatchjs/nightwatch/issues/3991#issuecomment-1969444042

Steps to reproduce

No response

Sample test

No response

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

No response

Nightwatch.js Version

3.3.7

Node Version

No response

Browser

No response

Operating System

No response

Additional Information

No response

ScraperWizard commented 9 months ago

I was considering resolving this issue by removing the elements with the same shared parentElement from the queue (Once an error has occurred). Would this approach be effective, or should I look for options to ungracefully exit the function?