Ask a Question

Is it possible to add column headers to excel file for DataSink

kenm
Contributor

Is it possible to add column headers to excel file for DataSink

Good afternoon all,

 

I'm using DataSink to excel to generate an input file for my application however I need the first row to contain column headers.

Can this be done natively?

 

I don't see an option to do it?

 

I tried adding an initial preceeding Data Sink teststep for the column headers however the subsequent datasink test step overwrites the whole file - So if someone knows how to configure an Excel Data Sink test step to append rather than overwrite that'll do the trick also.


Thanks in advance - Using SoapUI NG Pro FYI.

Cheers.

5 REPLIES 5
groovyguy
Community Hero

@kenm: If you open the DataSink, there's an option to "Append to existing file" which will provide the functionality and behavior you are looking for.




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!

Thx for the reply,

 

I'm afraid that option isn't there for excel data sink. I've had to take an ugly workaround where I've two data sinks to a txt file (one for the headers and one for the content I want from data generator), I think have a data generator using that csv file as an input and then export that to Excel. It's an ugly workaround for something I'd hope would have been available in the product by default?

@kenm: You can always write up what you want as a feature request. ReadyAPI Feature Request




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
nmrao
Community Hero

Not sure if it is mandatory to write into excel. Handling with csv is always simple; for at least these kind of stuff. A line can be easily added with groovy i.e., for headers if datasink can support csv file(hope it does).


Regards,
Rao.

Thanks guys,

 

Unfortunately excel is mandatory for my requirements. I ended up having to workaround leveraging groovy script to output headers to csv, data generator then appending to csv, then in turn use that CSV as a data source which in turn we'll utilize for a second data sink into excel.

 

A bit of an ugly long winded workaround but hope it helps someone.

cancel
Showing results for 
Search instead for 
Did you mean: