Content defintions are method calls and not map entries. You should use the
following:

static def ids = ['header', 'title', 'element1', 'etc']
static content = {
    ids.each { id ->
        "$id"({ $(id: id) })
    }
}

On Fri, Oct 13, 2017 at 5:32 PM, Adam Gilbert <
[email protected]> wrote:

> Hello,
>
> All the web elements I'm going to access have ID's, so I was hoping to
> define the content using just a list of expected ID's.
>
> for example:
> static def ids = ['header', 'title', 'element1', 'etc']
> static content = {
>     ids.each {[it: {$(By.id(it))}]}
> }
>
> However, it is unable to resolve any of them "as content or as a property
> on its navigator context".
>
> How should I be defining content through a list?
>
> Thanks,
> Adam
>
> --
> 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/ee85325a-8e23-4aed-8270-9cfb69e134ce%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/ee85325a-8e23-4aed-8270-9cfb69e134ce%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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%2B52dQQMxe9Hg4dNkh%2BiYW0SZ5NA88Zki5Jtb-Sua%2B_o75kgVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to