StaleElementReferenceException usually occurs when you update the DOM but
fail to set the page element to cache: false, wait: true.

http://www.gebish.org/manual/current/#code-cache-code

This happened in my case a few years ago. Not sure what might be happening
in your case but do check for DOM updates.

On Wed, Aug 10, 2016 at 11:53 AM, Brian Westrich <[email protected]> wrote:

> 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
> <https://groups.google.com/d/msgid/geb-user/99732e0a-fda7-43dd-8523-be93e37d73f5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Raviteja Lokineni* | Business Intelligence Developer
TD Ameritrade

E: [email protected]

[image: View Raviteja Lokineni's profile on LinkedIn]
<http://in.linkedin.com/in/ravitejalokineni>

-- 
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/CAJpE9rWdBpq9c4zsfkmzZqy8a99sCLtNThQquzXaGUEQ77wx7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to