Hello Geb users!
I'm really enjoying using Geb for testing, and especially appreciate the
informative error messages that Geb/Spock gives when tests fail.
Today we came across a possible exception to this rule. We found that if a
date comparison fails, the actual date value is not displayed, instead we
get a StaleElementReference exception as shown below.....
labRequest[0].dateField == requestDate
| | | | |
| | | | 2016-03-02T00:00
| | | false
| | geb.content.SimplePageContent@a4f7aef (renderer threw
StaleElementReferenceException)
| gov.bhnrc.modules.LabAnalysisRequestRow@2d4bfa3f (renderer threw
StaleElementReferenceException)
java.util.ArrayList@7fc57d59 (renderer threw GroovyRuntimeException)
We define the date field in the Page Object as follows:
dateField { $("div span input[name=dateSent]") }
and then do the comparison as follows:
def requestDate = '2016-03-02T00:00'
...
labRequest[0].dateField == requestDate
If the values of the two dates match, the test passes, but if they differ
then the above exception occurs.
I did a brief search through the recent mailing list archives, but didn't
see anything mentioned similar to this.
Has anyone else run across this?
-- Brian
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/99732e0a-fda7-43dd-8523-be93e37d73f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.