Forum Discussion
Hi,
I've finally worked out what I was doing wrong.
The relevant help page is here for anyone else that hits this - but it doesn't mention an important point (that I think it's worth mentioning for anyone else who is SoapUI challenged.
I've found what I was doing wrong. My hierarchy is as follows:
Datasource (Directory) - fileContents property POST Request (publishing fileContents property) to the webservice Datasource Loop
NOW - my directory has 3 files in it currently. When I ran the Datasource, I'd specified '0' as the number of rows to get (where 0=maximum number of rows). So it returned 3 rows. When I'd specified '0', the loop didn't appear to work (the testcase only executed once).
When I set the number of rows to be returned in the Datasource as '1' (each file has 1 line) - then the testcase executed 3 times!
Sorry for wasting anyone's time - but hopefully this will help anyone else that is struggling with this.
Thanks,
richie
richie Can you give a step-by-step explanation of what you were doing wrong? It seems like a simple thing that should be mentioned in the tutorial, but i am not sure where the issue is exactly.
- richie7 years agoCommunity Hero
Hi IgorG,
Yep - it's kindof obvious when you think about it, but anyway....
My scenario is that I have three flat files (| delimited testdata files) saved on my local drive. I need to post the contents of each of these 3 test data files to a web service using a REST (POST) request
My TestCase hierarchy was as follows:
Datasource(DirectoryType) with fileContents property REST (POST) request <---publishing the contents of the fileContents property Datasource Loop - Target = REST (POST) request
When you run the Directory Datasource, it prompts you with a query dialogue entitled 'Test data source' with the prompt text 'Specify the max number of rows to get (0 = all)'.
When I ran the Directory Datasource, it sources the file contents and passes them into the fileContents property - so the whole file string is on a single file. Because I had 3 files in the directory, when I ran the Datasource with '0' setting - it returned 3 lines of data. I then tried executing the test case (with the loop) but it executed only once.
I was specifying '0' originally and this what was causing the problem. This was what resulted in the testcase executing only once.
Once I changed the 'Specify the max number of rows to get (0 = all)' setting to '1' instead of '0' (so it sources 1 file at a time, rather than all 3 files initially) and executed the testcase, the loop function worked - i.e. - the test case executed 3 times, whereas when the setting was '0' (for all) - it executed only once.
So - as I said initially - it was user error - it's kindof obvious when you think about it - but ONLY after you think about it - so yeah - it might help to add this in the help.
I hope I've been clear in my description!
Thanks,
richie
Related Content
- 6 years agosanj
- 3 years agoMoUddin
- 3 years agoLucian
- 4 years agoMarkSchofer