davistark
14 years agoNew Contributor
how to run a Step Request for each file located in a folder
Hello! I'm a true novice with soapUI and Groovy Scripts. Now I have to do some task with this for my job but I'm don't really know how to do it.
First I will explain what the project does: Send a file (XML) to a server.
This was done with a "Step Request" (named "Publication of data"), and in his content there is the text XML which is sent to the server.
All this is done correctly, the problem is that every time I send a new file, I have to copy its contents (all file's text) and paste it into the Request Step (in the attached picture; I have to replace the text that is selected ).
My question is: how can I do to make soapUI read a folder where are all the XML files that I want send, and send them one by one?
I guess I have to create a "groovy script" to read the XML files located in a folder, copy its contents and put it in the Step Request (picture attached; replace the text that is selected by the one containing the XML file is been reading at the time).
I know, more or less, the script to read files in a folder, but I don't know how to make the Step Request (named "Publication of data") be executed for each XML file located in a folder with the contents of each XML.
Thanks in advance!

First I will explain what the project does: Send a file (XML) to a server.
This was done with a "Step Request" (named "Publication of data"), and in his content there is the text XML which is sent to the server.
All this is done correctly, the problem is that every time I send a new file, I have to copy its contents (all file's text) and paste it into the Request Step (in the attached picture; I have to replace the text that is selected ).
My question is: how can I do to make soapUI read a folder where are all the XML files that I want send, and send them one by one?
I guess I have to create a "groovy script" to read the XML files located in a folder, copy its contents and put it in the Step Request (picture attached; replace the text that is selected by the one containing the XML file is been reading at the time).
I know, more or less, the script to read files in a folder, but I don't know how to make the Step Request (named "Publication of data") be executed for each XML file located in a folder with the contents of each XML.
Thanks in advance!