Skip to content
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

When test fails, Selenide should report **exact** actual value at the moment of failure #217

Closed
asolntsev opened this issue Sep 6, 2015 · 0 comments · Fixed by #1566 or #1586
Closed
Assignees
Labels
Milestone

Comments

@asolntsev
Copy link
Member

Now it's possible that condition is not met at the moment when Selenide checks it. But at the moment of reporting error condition can be met. For example, this error message is misleading:

com.codeborne.selenide.ex.ElementShould: Element should have textCaseSensitive '09000525 FD: 1999-11-08' {.timeline-event-bubble-title}
Element: '<div class="timeline-event-bubble-title">09000525 FD: 1999-11-08</div>'
    at com.codeborne.selenide.impl.AbstractSelenideElement.checkCondition(AbstractSelenideElement.java:512)
    at com.codeborne.selenide.impl.AbstractSelenideElement.should(AbstractSelenideElement.java:476)
    at com.codeborne.selenide.impl.AbstractSelenideElement.invokeShould(AbstractSelenideElement.java:299)
    at com.codeborne.selenide.impl.AbstractSelenideElement.dispatchSelenideMethod(AbstractSelenideElement.java:179)
    at com.codeborne.selenide.impl.AbstractSelenideElement.dispatchAndRetry(AbstractSelenideElement.java:92)
    at com.codeborne.selenide.impl.AbstractSelenideElement.invoke(AbstractSelenideElement.java:67)
    at com.codeborne.selenide.impl.WaitingSelenideElement.invoke(WaitingSelenideElement.java:18)
I think that Selenide can be more "smart" and remember the stringified DOM element each time before checking the condition, so that when condition fails the error message is not contradictory.
@fokinp fokinp mentioned this issue Nov 12, 2020
3 tasks
asolntsev added a commit that referenced this issue Nov 14, 2020
... taken at the moment of last check, not at the moment of generating error message.
@asolntsev asolntsev linked a pull request Nov 14, 2020 that will close this issue
@asolntsev asolntsev linked a pull request Sep 23, 2021 that will close this issue
@asolntsev asolntsev self-assigned this Sep 27, 2021
@asolntsev asolntsev reopened this Sep 27, 2021
@asolntsev asolntsev added this to the 2.26.0 milestone Sep 28, 2021
@asolntsev asolntsev modified the milestones: 2.26.0, 3.0.0 Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment