Actually, was thinking more along the lines of:

def fillForm() {
    ids.each { /* it */ << 'foo' }
}



On Wednesday, October 18, 2017 at 5:29:21 PM UTC+11, Marcin Erdmann wrote:
>
> If you’re asking whether content defined in this dynamic way can be used 
> with form control shortcuts (used as target of assignements) then yes. 
> There is nothing special to content defined that way from Geb’s point of 
> view.
>
> On Wed, 18 Oct 2017 at 05:34, Samuel Rossinovic <[email protected] 
> <javascript:>> wrote:
>
>> Can templates declared in this method be used as targets of assignment 
>> (e.g. when their elements are form inputs)?
>>
>>
>> On Sunday, October 15, 2017 at 12:24:22 AM UTC+11, Adam Gilbert wrote:
>>>
>>> That works perfectly! Thanks for the quick and correct response!
>>>
>>>
>>> On Saturday, October 14, 2017 at 4:57:05 AM UTC-5, Marcin Erdmann wrote:
>>>>
>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/geb-user/2b661852-cf71-4836-b607-caa3d289d609%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/geb-user/2b661852-cf71-4836-b607-caa3d289d609%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/ac0151d3-dce6-4da7-8dda-9ee7c3adf403%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to