Forum Discussion

KSmith's avatar
KSmith
Occasional Contributor
18 years ago

DataSource problem

Hi

I am evaluating SoapUI pro and I would like to know if datasource configuration is dynamic:

I currently have a data source step that reads rows from an excel spreadsheet and feeds subsequent steps with data.

I would like to use one of the properties from the first data source step (above) to configure another data source step (DataSource and config parameters).

i.e. data from the first spreadsheet contains "another.xls", which will become the file from which the second data source step operates... 

Please let me know the best solution to this problem.

Thanks in advance,
K
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    Thanks for your interest! This should definitely be possible using property-expansion in the fileName field of the second datasource. So if the first DataSourceStep is called "DataSource 1" and the property containing the filename is called "datafile", you should be able to specify

    ${DataSource 1#datafile}

    as the Excel filename in the second DataSource..

    Hope this helps, let me know!

    regards,

    /Ole
    eviware.com
  • KSmith's avatar
    KSmith
    Occasional Contributor
    Hi Ole,

    Thank you for the property expansion lesson - it works perfectly!  I am very much enjoying working with your product.

    Regards,
    Karl
  • zxsoap's avatar
    zxsoap
    Occasional Contributor
    Hi Ole,

    Is it possible to have each of property response to one sheet in excel file? Yes, how to do it?

    I could not able to configure this way. Ex, the request have start_date and end_date. I want to configure in the same excel file which have two sheets and start_date will get data from sheet1 and end_date will have data from sheet2. So far, I have no luck.

    Thanks,
    zx
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    hmm.. maybe you could define one DataSource for each sheet (both using the same excel file), and then refer to the corresponding DataSource steps for the start/end_date values?

    regards,

    /Ole
    eviware.com
  • zxsoap's avatar
    zxsoap
    Occasional Contributor
    Hi Ole,

    How can I refer to the corresponding DataSource steps for the start/end_date values? I have Start_date, End_date on the same Excel file with different sheet, but could not know how to set them up on the script values.

    Thanks,
    zx
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    I was thinking like this:

    1) Create 2 DataSource steps, both referring to the same file but different sheets and each with their corrsponding properties (start_date and end_date)

    2) Refer to these 2 values using standard property-expansion in your request, ie something like:

    <startDate>${DataSource 1#start_date}</startDate>
    <endDate>${DataSource 2#end_date}</endDate>


    makes sense?

    regards,

    /Ole
    eviware.com