Forum Discussion

Umea_universite's avatar
Umea_universite
Occasional Contributor
12 years ago

[R]Using result from Groovy select statement i next test ste

Hello!

I have this in a Groovy SCRIPT teststep

def result = sql.rows("select * from NAMN limit 1");



How can I use the answer in further test steps?

Best,
Rikard

1 Reply

  • Umea_universite's avatar
    Umea_universite
    Occasional Contributor
    I solved the problem by using MarkupBuilder:


    try {
    xml.PERSONS
    {
    sql.eachRow("select * from NAMN limit 1") { row ->
    PERSON
    {
    Pnr(row.pnr)
    LastName(row.enamn)
    FirstName(row.tnamn)
    }
    }
    }

    } catch (Exception e) {
    log.error "Error: ...";
    }


    which generates a XML that I can refer to in the following test request. Party!

    / Rikard