Forum Discussion

bdre's avatar
bdre
Occasional Contributor
7 years ago

how to access a datasource result from calling groovy script

I've created a Groovy datasource that returns information in the results associative array available when the datasource script runs. Now I want to run that datasource from another groovy script, bu...
  • Lucian's avatar
    7 years ago

    Hi,

     

    Each DataSource step has at least 1 property. 

     

     

    In order to reference that property you can use the syntax:

     

    ${DataSource#testProperty}

    If you want to reference that property from a groovy script you need to use:

     

    context.expand( '${DataSource#testProperty}' )

    But I am not sure I understand your question... Normally I would use a datasource step in combination with a datasource-loop step.

     

     

    So there will be an execution for each element in the datasource. Why would you call yours with another groovy script? What is the use case?