Forum Discussion
I know this isn't what you asked, but have you concidered using a Directory type Data Source step (paired with a DataLoop test step), these test steps will take care of all the complexities of looping through a directories of files, keeping track of the current file, etc.
Attached is a trivial TestCase example of how to do this (Just import it into one of your TestSuites). While using Groovy is an invaluble tool, I always try to use the built-in test steps if there is one that does what I need. It tends to be a lot quicker, and I personally like the fact I can look at the list of test steps in a test case and get a good idea of whats going on by looking at the types.
Note: While the documentation states the current file contents are put into the first property and all others are blank, as you will see from the attached example the second property is named "fileName" and this does contain the filename. Perhaps someone from SmartBear could comment? Is this just a case of functionality missing from the docs?
Thanks Radford. I'm a functional consultant and tasked with testing a mass amount of order completions so I don't have the technical background to do much more than copy, paste and tweak. My current design works (maybe not the most elegant option) and was based on the one script I could find that actually loops through a bunch of individual xml files:
http://www.codeproject.com/Articles/820414/Automating-SoapUI-using-Groovy-A-Walk-Through
I've already processed thousands of records successfully but when this effort is done I'll see if I can redesign it based on your example.
I appreciate it.