Ask a Question

Datasource Loop with Script

Occasional Contributor

Datasource Loop with Script

Hi, i am new in this field. But i have made some test with Ready API and these works fine.

I have a simple question:

I have in my Test 4 Parts.

1. Datasource

2. Datasource Loop

3. A Soap Request with Data

4. a Groovy Script to writes the Response Files


How i can put in the Loop my Groovy Script ? These Loops run only with the DatasourceLoopReport and the GetDocument.





Community Hero

Re: Datasource Loop with Script

Hey @stefankranz,

The DatasourceLoop step is typically the last step in the sequence.... i may be misunderstanding the purpose of your test but if you alter the sequence of steps as follows, wouldnt this solve thr problem?

GET (SOAP) base64.encoded
Groovy (base64.decode)

Wouldnt the above satisfy and include the decode in the loop or am i missing something?


if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Community Hero

Re: Datasource Loop with Script

There are couple of options, have response writing logic in one of the below:
- Use events feature AfterStep, but save conditionally (i.e.,only if the step name is specific so that it won't write for unwanted steps).
- the script assertion (i understand it is a bit wierd, but it can do the job)

And you wont need the additional groovy script test step.

Community Manager

Re: Datasource Loop with Script

Thank you so much nmrao and richie!


@stefankranz , did you have a chance to try out the approaches the Community suggests? Please share your progress with us.

Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Showing results for 
Search instead for 
Did you mean: