-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
The chained commands in new element api continue executing even when previous command has failed. #3991
Comments
I think I am encountering something similar, but not necessarily with find, at least not directly. In my case I believe the tests seem to continue when it can't locate an element on the page, but I'm using |
After hours of debugging, I did manage to find a solution. nightwatch/lib/api/web-element/scoped-element.js Lines 169 to 182 in ae23267
If we just add What do you think @garg3133 will this work? here it is action: test:
without
after adding
|
Listing the current issues I can see here if the element is not found:
The above issues can be taken up separately. |
@dikwickley Doing Also, if we want to abort the test case completely, then also doing For now, let's forget about the |
@garg3133 Cant we just get error.name and then suppress them accordingly? Something like :
and then later down the line suppress it using
|
@Honey2339 We don't want to always suppress the |
From what i understood, As soon as we encounter an error the code has to throw that error and not the chained commands. Please have a look on the attached video issuehelperer.mp4 |
@Honey2339 In your case the code is throwing an |
Description of the bug/issue
Nightwatch continues to execute further commands even when the previous
.find()
command fails and returns an error response.Steps to reproduce
Just run
browser.element.find('.invalid_selector').getProperty('innerHTML');
.Even after getting no elements from the
.find()
command, it will still try to run the.getProperty()
command.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
The text was updated successfully, but these errors were encountered: