Page 1 of 1

simpledataconnector to csv

Posted: Wed Jan 25, 2017 8:22 pm
by mander95
Is it possible to convert the simpledataconnectors generated in ranorex to a CSV file? I don't mean switch the reference to a csv connnector in another location. I mean take the data in a simpledataconnector and make a CSV file from that data.

Re: simpledataconnector to csv

Posted: Wed Jan 25, 2017 8:50 pm
by krstcs
There is no built-in mechanism to do this.

Have you tried copying and pasting the data from the Simple Data Connector into the CSV file? You would likely need to add the delimiters (commas - ",").

Unfortunately the data for Simple Data Connectors is stored directly in the XML of the test suite file (*.rxtst) so you wouldn't be able to copy and paste from there without doing a whole lot of manipulation.

Your other option is to create some test modules that create the file, write a line of data, and close the file. In your suite it would look like this:


MySuite
-TC1
---CreateFile (Module)
---TC2 <-> Simple Data connector
-----WriteData (Module - Bind variables to the data connector's columns)
---CloseFile (Module)

Re: simpledataconnector to csv

Posted: Mon Jan 30, 2017 8:18 pm
by mander95
got it, thank you :D :D

Re: simpledataconnector to csv

Posted: Wed Feb 01, 2017 6:54 pm
by sergii
I think you can just copy and paste the whole table into excel and then save it as CSV.

Alternatively you can grab the XML representation from the suite file and using mass replacement (Sublime 3 or notepad++) to replace tags and brackets "/><" with respective commas.
A little bit of time required to figure out correct regex to replace what with what :)

Online version are not as mature to get the job done, but they might give you a good start: http://www.convertcsv.com/xml-to-csv.htm

Re: simpledataconnector to csv

Posted: Thu Feb 02, 2017 9:29 am
by odklizec
Hi guys,

It's possible to export entire data set table via "Export CSV" option available in "Preview Effective Data Set" window...
ExportCSV.png
A small downside of this solution is that the Preview Effective Data Set displays data from all parent data connectors. So you may need to edit exported csv in case the data connector in question is located in nested TC.

Re: simpledataconnector to csv

Posted: Thu Feb 02, 2017 3:20 pm
by krstcs
Ah, well, learn something new everyday...

I use the SQL Server connector 99.9% of the time, so I had never seen that.

Thanks Pavel!