Re: [geb-user] Strange behavior for element

2 views
Skip to first unread message

tho...@posteo.de

unread,
Dec 8, 2020, 2:47:14 PM12/8/20
to geb-...@googlegroups.com
Often times, certain elements only appear on the page after some
Javascript has run.
At the point of time when you check manually, the element is already
available, but the automated test might be too fast.

Try this:
otherInsuranceAmount(wait: true) { $('[id$=otheramount]') }

Am 08.12.2020 16:16 schrieb Ben Frey:
> I have an element on a page that's defined like this:
>
> otherInsuranceAmount { $('[id$=otheramount]') }
>
> When I debug my test and put a breakpoint at the "at MyPage" line, I
> get a MissingPropertyException when I try to inspect
> otherInsuranceAmount via the debugger. However, the expression
> $('[id$=otheramount]') resolves just fine. What could cause this to
> happen, and how do I fix it?
>
> --
> 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 geb-user+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/41b1a9f1-b402-485f-9f97-da5e7463cbfcn%40googlegroups.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/geb-user/41b1a9f1-b402-485f-9f97-da5e7463cbfcn%40googlegroups.com?utm_medium=email&utm_source=footer

Marcin Erdmann

unread,
Dec 9, 2020, 3:51:53 PM12/9/20
to geb-...@googlegroups.com
If you put the breakpoint at the "at MyPage" line then the page reference has not yet been switched to an instance of MyPage and that's probably why you're getting a MissingPropertyExpression when trying to evaluate "otherInsuranceAmount". I would suggest putting the breakpoint after that line or trying to evaluate "at(MyPage).otherInsuranceAmount".

On Tue, Dec 8, 2020 at 3:16 PM Ben Frey <sparta...@gmail.com> wrote:
I have an element on a page that's defined like this:
otherInsuranceAmount { $('[id$=otheramount]') }

When I debug my test and put a breakpoint at the "at MyPage" line, I get a MissingPropertyException when I try to inspect otherInsuranceAmount via the debugger. However, the expression $('[id$=otheramount]') resolves just fine. What could cause this to happen, and how do I fix it?

--
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 geb-user+u...@googlegroups.com.

tho...@posteo.de

unread,
Dec 9, 2020, 4:05:31 PM12/9/20
to geb-...@googlegroups.com
Right, when I wrote my suggestion, I did not consider the problem you
have with the debugging process itself.
I mistook MissingPropertyExpression for ElementNotFoundException.

But keep in mind that when debugging, you are changing the timing of the
browser communication, which might cause the problem not to be
reproducible that way.
>> [1].
>
> --
> 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 geb-user+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/CA%2B52dQRO7DK8w%2BsPpo2vpAV9AB6x%3DvRbsPVrm6DK9tKgWDV-fA%40mail.gmail.com
> [2].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/geb-user/41b1a9f1-b402-485f-9f97-da5e7463cbfcn%40googlegroups.com?utm_medium=email&amp;utm_source=footer
> [2]
> https://groups.google.com/d/msgid/geb-user/CA%2B52dQRO7DK8w%2BsPpo2vpAV9AB6x%3DvRbsPVrm6DK9tKgWDV-fA%40mail.gmail.com?utm_medium=email&utm_source=footer
Reply all
Reply to author
Forward
0 new messages