Page 1 of 1

Connecting CSV file programatically

Posted: Thu Apr 14, 2016 5:37 pm
by Jenny
Hi,

I was trying to connect CSV file by writing the connection string programmatically. I need to establish the connection to the CSV file and then need to read the file row by row and column by column.

Ranorex.Core.Data.CsvDataConnector csvConnector = new
Ranorex.Core.Data.CsvDataConnector("myCSVConnector", "C:\\Users\\Public\\Documents\\ Filename.csv",
true);
Ranorex.Core.Data.ColumnCollection col;
Ranorex.Core.Data.RowCollection row;
csvConnector.LoadData(out col, out row);

But I'm getting an error in the connection string, and the error is "The typename CsvDataConnector does not exist in the type Ranorex.Core.Data.CsvDataConnector"..Am I missing any assembly reference file here?
I have 1) using Ranorex, 2) using Ranorex.Core, 3) using Ranorex.Core.Testing reference files.

Please let me know what assembly reference I need to add here.

Thanks for any help,
Jenny

Re: Connecting CSV file programatically

Posted: Fri Apr 15, 2016 8:42 am
by odklizec
Hi Jenny,

The code looks OK to me.
What version of Ranorex are you using? Latest is 5.4.6.
Have you tried to reinstall Ranorex?
Could you please post a sample project?

Re: Connecting CSV file programatically

Posted: Mon Apr 18, 2016 9:31 pm
by Jenny
I made it work , It worked after I added 'Ranorex.Controls' in my class file

Thanks!

Re: Connecting CSV file programatically

Posted: Mon Apr 18, 2016 10:02 pm
by Jenny
Hi,

In my application , I have many lists and many checkboxes in a window called XYZ. The list1 named ABC contains 10 check boxes named 1,2,3,4---10.The list2 named PQR contains another 10 checkboxes named a,b,c,d,e,f..j. Then I have an attached CSV file that has the column ABC and PQR with values 1,2,3,4...10 and a,b,c,d,e...j. What I need to do is read CSV file row by row , column by column. It should take each cell data and then check the checkbox according to the cell values in the lists.For example read 1st celldata 1 under list ABC and then check the checkbox 1 under list ABC, celldata under list PQR and check the checkbox under list PQR in the application. Then read next row , and goes on until the end of CSV file.

Can you tell me how to read specific cell data from csv file and then check the checkbox accordingly..
Thanks for any help.

Regards,
Jenny

Re: Connecting CSV file programatically

Posted: Tue Apr 19, 2016 7:33 am
by odklizec
Hi Jenny,

Could you please post a Ranorex snapshot of the window in question? A CSV sample would be nice too.

You see, it's pretty hard to suggest something reliable just from the description of your problem. It would be much easier to suggest something with Ranorex snapshot (sample app would even better) ;)

Re: Connecting CSV file programatically

Posted: Wed Apr 20, 2016 4:21 am
by Jenny
Hi,
I have attached my sample CSV file and the sample window in my application. Let me know how to read the cell data and put the checkmark in the application according to the celldata.

Thanks,
Jenny

Re: Connecting CSV file programatically

Posted: Wed Apr 20, 2016 7:03 am
by odklizec
Hi Jenny,

Thanks for the csv. Now please post also Ranorex snapshot (look here how to create one), not screenshot ;) Screenshot is unfortunately not very helpful.

BTW, if I understand you right, you want to 'check' each check box, based of the checkbox names stored in CSV?