Forum Discussion

Cleveburgian's avatar
Cleveburgian
New Contributor
15 years ago

Multi-Worksheets from the same file w/ DataSource DataSink?

Hi

I am using a combination of datasink and datasource / loops to construct data driven tests for some fairly lengthy web service testing I need to do.

Without going into too much detail - I'm encountering a problem when I try to use different Worksheets from the same Excel file within the same test case.

Here's a summary:
In step 1 - I use DataSink to store the contents of a response to a coordinate in Excel (e.g., Sheet1:A2 ). This seems to work - when I run this step alone I can see contents of the response being written back to Excel when I open the file. However all that changes when I append another step to the test case.

In step 2 - I add a DataSource reference that pulls in the contents of Sheet2. Sheet2 has a formula that points to the data stored from the first step. (e.g, Sheet2:D2 = Sheet1:A2)

When I try to use a property that references Sheet2:D2 in the XML being sent back - the response fails. Sure enough - when I go back and open up the file - the data that was previously written to Sheet1:A2 isn't there. However ... like I said - it WAS getting written before I added step 2 (the DataSource step).

What am I doing wrong? Am I using the incorrect datasource configuration options? I currently have the following selected:

Y = Sets to share DataSource between running threads during a load test
Y = Preloads available data if possible

Thanks in advance for your help!
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Just some ideas:

    1) I wonder if the spreadsheet recalculates while being accessed by soapUI? I think it is just reading the file and not instantiating a spreadsheet object, so formulas referencing updated fields would not have new values.

    2) Are the values not written because the test case fails?

    Just my 2 cents, I may be completely off.
  • Thanks so much for your reply.

    I think you're right . . . the recalc on open (from within excel) doesn't seem to work when SoapUI is accessing the file. Sigh. Time to come up with plan B.

    Thanks again!
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Could you just add another datasink that updates the second sheet at the same time as the first, rather than using a formula?