Brian,

The fact that you are getting these exceptions means that the content you
are accessing is removed from DOM between the evaluation and reporting. So
I can see the following options:
- the content you are accessing is being replaced constantly in the page
- your waitFor condition passes before the page state has stabilised

What happens if you wrap your failing condition in a waitFor:

waitFor { labRequest[0].dateField == requestDate }

Of course, this is not the end solution because you don't want to wait that
long for the failure but if you please could try it and share the result
then it would help in debugging this.

One more thing, Is this code you shared coming from test, a page class or a
module class? This is important due to modules having base navigator which
might get stale. But if that was the case then I'd expect the error you're
seeing to be different.

Also, can you please share which version of Spock you are using?

On Mon, Aug 15, 2016 at 8:32 PM, Brian Westrich <[email protected]> wrote:

> On Sun, Aug 14, 2016 at 2:57 PM, Marcin Erdmann
> <[email protected]> wrote:
> >
> >  Did you make a mistake and include the old report instead of the new
> one? Can you also please show how you used the waitFor() method?
>
>
> Marcin,
>
> You are correct that the two test failure reports that I posted are
> identical. I didn't notice they were the same when I posted the 2nd
> report.
>
> Here's how I coded the waitFor....
> waitFor {
>     labRequest[0].labNameField.value()
> }
> labRequest[0].dateField == requestDate
>
> As coded above, the test passes if the two dates to be compared are
> equal, and throws a StaleElementException if the two dates are not
> equal.
>
> A colleague of mine had coded the waitFor a different way and gotten a
> different test failure report than mine, but he's not available for
> the next month or so (traveling to a different country) so I can't ask
> him the way he coded the waitFor.
>
> Does the way I coded it look correct to you?
>
>
> 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/CAMvxi92vVs61mWXzwhM4KmNs%2BYkQoZFSyyPi49smnAFWdeqanA%
> 40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2B52dQRUjd630aZLwLF9UCffkrXPAqLJ%3DL%2BUTJ0eBK580xzhWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to