Forum Discussion

annika's avatar
annika
Occasional Contributor
13 years ago

help me to exit different datatypes than string outof groovy

I want to exit different datatypes than string out of groovyskript. I only know setProperty and getProperty. Are there more possibilities to use Data created in one groovystep in another.
  • Hi annika,

    Can u explain little elaborate? I am not able to get your question.

    Thanks & Regards
    Saravanan Ramamoorthy
  • annika's avatar
    annika
    Occasional Contributor
    thank you for awnsering, i try to explain more.
    I want to store some Information in a Grovystep like I do, when I use testRunner.testCase.setPropertyValue('Name',name). But this comand only takes strings and I need to exit more complicated Information out of the Groovy step. I want to export something like a map to use it in another groovystep later.
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Put the map in the context in the first Groovy script:

    context.put('mymap', mamap)

    Then use it in the subsequent Groovy script:

    def mymap = context.get('mymap')
  • annika's avatar
    annika
    Occasional Contributor
    Thank you so much for your awnser. this works well and is easy to handle. I also used it for groovyclosures.