-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
added <no such element> to array of DO_NOT_LOG_ERRORS #141
Conversation
Would you mind explaining this a bit more in detail ? regards |
We have been getting consistent errors from the Selenium driver whenever an element is not found. We are exclusively testing JS driven, dynamic sites, so the element is often not found. Then Nightwatch polls and the element is there. In this case, the error shows up on the command line, polluting the Nightwatch results. I simply added the error that is bugging us to the ignore list, which right now only has 'Unable to locate element'. Does that help? |
Yes, it did but i would like to slightly disagree. What about beeing more "defensive" when writing the tests ? Since all this sfuff is async you actually have to waitFor... some things to be present or happen in the page.. I'm not fighting against the "do-not-log" request just asking.. regards |
Basically, we have the choice of writing a As for defensive tests, trust me we are doing that. But there are things that plain and simply have to be waited on, and Nightwatch should not be throwing errors on valid commands. |
@davidlinse the issue is actually pretty simple. This isn't a question about the structure of the tests themselves, and whether or not they should be more defensively written. This happens when you are using the waitFor... commands in tests. Because the command polls while waiting for the presence of an element, it's outputting when the element is not found during the command's execution. It should only output a not found error if the element is truly not found, not when it's not finding the element while polling for it. Does this make more sense? |
yes, sir ! |
Cheers! |
As far as I can see the 'no such element' string never appears in the error message itself, it appears only in the Considering the error response below the error message should not be shown so I'm curious in what circumstances you are getting the {
status: 7,
sessionId: 'example-123456',
value: {
message: 'Unable to locate element: {"method":"css selector", "selector":"some-element"}',
state: 'no such element'
}
} Are you referring to the case when the test is ran with |
We are using v2.39.0 of Selenium with Chrome and Chromedriver v2.8.x The Here is the full error:
This entire message appears in the Thanks |
FYI.. there is a selenium 2.4x out already
|
True, but I get the same error. Like i said, I am pretty sure it is the Chromedriver and this would be a very simple fix. |
👍 |
Same issue I am having. Only happens when using waitForElementPresent. While it's polling it fails, giving the error, and then eventually passing. This also pollutes Jenkins results with a false fail. |
Alright then, the error message is different for chrome driver. So much for consistency. I think in this case checking the state property would have worked better but for now let's just get this out of the way. |
added <no such element> to array of DO_NOT_LOG_ERRORS
Is a new version going to be published on NPM soon? |
yes, shortly. |
Great. Thanks, Andrei! |
no problem, it's in npm now. |
👍 |
This just adds 'no such element' to the DO_NOT_LOG_ERRORS list. This one has been causing us lots of grief with the elementPresent and waitForElementPresent commands.
Thanks!
Keith