simpledataconnector to csv

Ask general questions here.
mander95
Posts: 66
Joined: Tue Jun 21, 2016 7:35 pm

simpledataconnector to csv

Post by mander95 » Wed Jan 25, 2017 8:22 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: simpledataconnector to csv

Post by krstcs » Wed Jan 25, 2017 8:50 pm

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)
Shortcuts usually aren't...

mander95
Posts: 66
Joined: Tue Jun 21, 2016 7:35 pm

Re: simpledataconnector to csv

Post by mander95 » Mon Jan 30, 2017 8:18 pm

got it, thank you :D :D

sergii
Posts: 30
Joined: Fri Jun 07, 2013 11:07 pm

Re: simpledataconnector to csv

Post by sergii » Wed Feb 01, 2017 6:54 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3908
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: simpledataconnector to csv

Post by odklizec » Thu Feb 02, 2017 9:29 am

Hi guys,

It's possible to export entire data set table via "Export CSV" option available in "Preview Effective Data Set" window...
ExportCSV.png
ExportCSV.png (22.15 KiB) Viewed 466 times
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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: simpledataconnector to csv

Post by krstcs » Thu Feb 02, 2017 3:20 pm

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!
Shortcuts usually aren't...