Forum Discussion

Andrew_H's avatar
Andrew_H
Occasional Contributor
15 years ago

soapUI Pro - using Directory DataSource Randomly

Hello,

I have a large directory of XMLs that I would like to be the input for some load testing I am doing. For each initeration of the load test I would like to open a XML and access certain values that will go into the new XML for the test as I need to manipluate some of the data in the XMLs in the directory for testing. The selection of XML files could be random or sequential, doesnt matter to me as long as I am not using the same XML file over and over. Here is what I believe I have to do, but am not sure how to put it together and make it work:

1. Create a Directory DataSource that defines the directory, and the FileName filter as .xml
2. Create a XML DataSource that defines the Directory Datasource as the Source Step and the XPath of the value I want to access
3. Repeat step 2 for each value in the XML I want to access

Where I am stuck is:

1. How to I randomize or step through each file in the directory so it doesnt look at the same one for each initeration. I am guessing I need a groovy script for this, but have no idea how to write that and specify it in the Directory DataSource configuration

2. How do I define a 'Source Property' in step 2? When I define the 'Source Step' as my Directory DataSource, no options are available in the drop down.

Any insight or examples is much appreciated.

Thanks

Andrew
No RepliesBe the first to reply