parameterized moduleList usage for multiple parameters

Skip to first unread message

Pooja Kurbetti

Feb 21, 2017, 1:59:13 AM2/21/17
to Geb Development Mailing List
Just wanted to check the way i am call the module is correct or incorrect

If below is the code snippet
class ParameterizedCartRow extends Module {
    def nameIndex
    def quantityIndex
    def priceIndex

    static content = {
        cell { $("td", it) }
        productName { cell(nameIndex).text() }
        quantity { cell(quantityIndex).text().toInteger() }
        price { cell(priceIndex).text().toBigDecimal() }

class CheckoutPageWithParametrizedCart extends Page {
    static content = {
        cartItems {
            $("table tr").tail().moduleList {
                new ParameterizedCartRow(nameIndex: it, quantityIndex: it+1, priceIndex: it+2)
Can i call this as
When i tried to call the parameterized moduleList
I got an error stating :
Condition not satisfied:

Marcin Erdmann

Feb 21, 2017, 5:27:37 AM2/21/17
to, Geb User Mailing List
Hi Pooja,

Why do you need to make your row module parameterized? Aren't indexes fixed in it anyway? Isn't the name column always the first column, quantity the second and price third? Am I missing something here?

What are you expecting (and why?) to be passed as `it` to your closure that you use with `moduleList()`? That method doesn't pass anything to your closure.


P.s. Please ask similar questions on the user mailing list (CCed) in the future as this list is about development of Geb and not its use.

You received this message because you are subscribed to the Google Groups "Geb Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit
Reply all
Reply to author
0 new messages